Finding the lowest value and highlighting in DAX

have the Sale date and in that, we want to show the month-wise revenue in that the client wants to see the lowes revenue of the month in each year for that we want to write a DAX function

Step 1:

Write a calculated table to get the Dates from the CalenderAuto() function also from the date function we need

Month =Calendar[date].[Month]

Step 2:

Get the Total Revenue in the measure

Total Revenue = Sum(SalesTable[Revenue])

Step 3:

Write the following DAX function

Lowest Monthly Revanue =

var _MonthlyRevanue =

CALCULATETABLE(

ADDCOLUMNS(

SUMMARIZE(Calender,Calender[month]),

“@Revanue”,[Total Revenue]

),ALLSELECTED()

)

Var _minRevanue =

MINX(_MonthlyRevanue,[@Revanue])

var _CurrentRevanue = [Total Revenue]

Var _result = If(_minRevanue = _CurrentRevanue,”Red”,”Green”)

return

_result

Step 4 :

In the bar chart month as an axis and value as a revenue

The format the bar chat and then convert the data colour to function and select the measure you created

Now the bar chart will be shown the lowest revenue in red

Follow us for more such topics and suggestions.Also, click the link below to follow us in LinkedIn https://www.linkedin.com/showcase/sphyzee-analytics/about/

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Coding Linear Regression From Scratch…

Top Big Data Certifications To Seek in 2021

Big data Certifications

Experience at LetsGrowMore

A Simple but Effective Interview Prep Trick

Implementing Naive Bayes in 2 minutes with Python

Hyperparameter Tuning: A Practical Guide and Template

Recommending our Lives

Understanding Vectors

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sphyzee Analytics

Sphyzee Analytics

More from Medium

We have the sale date and in that, we want to show the month-wise revenue in that the client wants…

A Beginner’s Guide to Power BI Desktop

Two Cool Ways to Limit Slicer Selections in Power BI Desktop

What is Row-Level Security in Power BI?