The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
13 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
8 | |
8 |