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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.