Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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.
Report Link:
Thank you
Kind Regards,
Aamir
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:
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |