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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Noeleke1301
Helper III
Helper III

Conditional format with comparison value with limit

Sorry for the confusing title, but could someone help me with the following problem?

 

I have a graph, which calculates a summed value over time (based on startdate and enddate of that row).
Now I want to conditional format this graph, and show on which dates a limit has been crossed. I've created an IF measure which puts a 1 or 0 whether or not the limit was crossed, but my graph just always shows that the limit has been crossed.

 

My format measure:

Chart color formatting = 
SWITCH( TRUE() ,
    [ONVERGUND_ON_TERM] > 0 , "#e01021" ,
    [Over limit] > 0 , "#99a12a" ,
    "#1fa62b" )

 

My graph:

Noeleke1301_0-1684230731457.png

 

My "over limit" measure:

Over limit = 
Var _Limit = SELECTEDVALUE( DimADRLimit[LIMIT] )
Return
MAXX( Terminalmgmtinfo , IF( [NETT_TON_ON_TERM] > _Limit , 1 , 0 ) )

 

The table which shows a specific date when I click on it in the graph:

 

Noeleke1301_1-1684230804671.png

 

I think maybe the total column might be the problem, because it's always 1 no matter the individual "over limit" values.

 

I need the bar in the graph to be yellow if at least one of the individual "over limit" values is 1. I tried with MAXX to make it row specific, but no luck.

 

Please help!

1 REPLY 1
Anonymous
Not applicable

HI @Noeleke1301,

In fact, your formula not suitable to use with aggregate values. (SELECTEDVALUE function will return blank if you not setting alternate result and use it handle aggregate multiple rows)

When you use it in table visual with other fields, there are some other category fields help expand the aggregated row context and let the formula calculated on the detail row levels to get correctly results. 

SELECTEDVALUE function - DAX | Microsoft Learn
Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.