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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Conditional formatting base on static average for week

Hi I have a table visual in my report which repersents the raw dataset to users so that they can drill down to it. 

The logic is to highlight rows which are have "duration" higher than the average for its category ("banneraverage"). Desired outcome is as such with my manual highlighting.

 

ladyhaley_0-1615922902530.png

 

 

 

I seem to not be able to achieve this as when I put in the condition it will always outcome to be lower than duration as you can see by the third column with normal dax AVERAGE function.

 

 

 

BannerAverage = CALCULATE(AVERAGE('Truck Turnaround'[Duration (Mins)]), FILTER(ALLEXCEPT('Cat'),'Cat'[Banner]))

 

 

 

I have also tried 

 

 

Condition =
VAR _PNSavgdur = CALCULATE(AVERAGE('Truck Turnaround'[Duration (Mins)]), FILTER('Store Mapping', 'Store Mapping'[Banner] = "PNS"))
VAR _NWavgdur = CALCULATE(AVERAGE('Truck Turnaround'[Duration (Mins)]), FILTER('Store Mapping', 'Store Mapping'[Banner] = "NW"))
VAR _4SQavgdur = CALCULATE(AVERAGE('Truck Turnaround'[Duration (Mins)]), FILTER('Store Mapping', 'Store Mapping'[Banner] = "4SQ"))
VAR _duration = SUM('Truck Turnaround'[Duration (Mins)])

RETURN IF(_NWavgdur > _duration || _4SQavgdur > _duration || _PNSavgdur >_duration,1,0)

 

 

 Then use rule conditioning but think this will also not work  because of the sum aggregate function.  And values disappears. 

ladyhaley_0-1615923826154.png

 

 

Please help? As this seems like a rather simple thing to achieve but I am unable to achieve it.

 

 

 

 

1 REPLY 1
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you pls upload your .pbix file to onedrive business and share the link with us?Cant test without data...

Remember to remove the confidential information inside.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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