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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
aAmirkHan
Helper II
Helper II

Conditional formatting in field paramete

Hi,

I am trying to make this visual which changes color based on average line in field parameter by taking example from below report.

Can you please help and advise how to build this report? Please refer below screen shot for your reference along with report link.

 

aAmirkHan_0-1688540289026.pngaAmirkHan_1-1688540303774.png

 

Report Link:

Restaurant Power BI Report

 

Thank you

 

Kind Regards,

Aamir

1 REPLY 1
barritown
Super User
Super User

Hi @aAmirkHan,

The solution may vary depending on your dataset, but the idea is:

1) You create a measure to calculate some average parameter:

 

 

Avg Sales = AVERAGEX ( SUMMARIZE ( Data, Data[Period], "Week Sales", CALCULATE ( SUM ( Data[Sales] ) ) ), [Week Sales] )

 

 

2) You use this measure to define the colour with another measure like this:

 

 

Colour = 
VAR AvgSales = CALCULATE ( [Avg Sales], ALL ( Data ) )
RETURN IF ( SUM ( Data[Sales] ) > AvgSales, "gray", "orange" )

 

 

3) Then you apply it as a conditional colour - and it works:

barritown_0-1702998008535.png

Please check the attached PBIX file.

If you wish to link it with a field parameter slicer, no problem - you need just to link it to the right value and modify the initial measure so it takes into account, which parameter is chosen there.

Update: I've added a slicer and alternative line to illustrate the approach.

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

 

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.