Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

DAX to show Total value by Month highlighting High and Low or Max and Min data points.

Hello Community Members

 

I'm struggling with this DAX, objective is to create a measure to show High and Low data points for total utility consumption per month. The date is coming from the date table which got Date, Year, Month of Year, Quarter of Year, Day of Month as field list.
[Total Utility] is DAX measure.

 

With this DAX, I'm aiming to achieve 1 against High and Low value by month and then with the help of conditional formatting, I highlight '1' in my Line chart or Clustered Column. But somehow my DAX is not working, Ideally i like to see 1 against the blue circled value., instead I'm only getting 1 for the highest value for the whole selected range for the year.maxmin.PNG

Tried using MINX / MAXX with ALLSELECTED or SUMMARIZE and ADDCOLUMNS nothing working. My current DAX which is not giving the desired output is below mentioned. Please suggest any tweaks or new DAX.

 

OVERALLMAXMIN =
VAR ELECTRIC = [Total Electric]
VAR MAXELECTRIC =
MAXX(ALLSELECTED('Date'[Year],'Date'[Month]),[Total Electric])
VAR MINELECTRIC =
MINX(ALLSELECTED('Date'[Year],'Date'[Month]),[Total Electric])
VAR RESULTS =
IF(ELECTRIC=MAXELECTRIC || ELECTRIC=MINELECTRIC,
1,
0
)
RETURN
RESULTS
2 REPLIES 2
lbendlin
Super User
Super User

IF(ELECTRIC=MAXELECTRIC || MAXELECTRIC=MINELECTRIC

 

Did you want to write

 

IF(ELECTRIC=MAXELECTRIC || ELECTRIC=MINELECTRIC

 

?  You  can also use the IN {} construct if you want.

Anonymous
Not applicable

Thanks @ibendlin

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.