The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all!
I'm running into an issue that really stumps me. I want to differentiate the top 5 bars in a bar chart by giving them a different color and I keep running into a wall. It has to be done using a measure as the top 5's need to change when filtering.
I've been trying to write a measure with the TOPN dax function that can either be inserted as a legend or as a field value in conditional formatting, but I can't get the syntax right.
Not omitting an example due to laziness - I just had nothing worth posting 😅
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I hope the below can provide some ideas on how to create a solution for your datamodel.
Hi, @SleveMcDichael
You can try the following methods.
Measure:
Rank = RANKX(ALL('Table'),CALCULATE(SUM('Table'[Value])),,DESC)
Color = IF([Rank]<=5,"Green")
Result:
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @SleveMcDichael
You can try the following methods.
Measure:
Rank = RANKX(ALL('Table'),CALCULATE(SUM('Table'[Value])),,DESC)
Color = IF([Rank]<=5,"Green")
Result:
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I hope the below can provide some ideas on how to create a solution for your datamodel.
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |