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 community,
Product | Avg. Rating | Reviews |
Product A | 5 | 1 |
Product B | 5 | 226 |
Product C | 5 | 2 |
Product D | 5 | 3 |
Product E | 5 | 2 |
Product F | 5 | 7 |
Product G | 5 | 3 |
Product H | 4.86 | 84 |
Product I | 4.85 | 27 |
Product J | 4.83 | 78 |
Product K | 4.8 | 7 |
Hi,
Please try something like below.
When showing top one based on two or more criteria, I suggesting try to use INDEX DAX function.
INDEX function (DAX) - DAX | Microsoft Learn
Top Rated Product KPI: =
CALCULATE (
MAX ( DIM_PRODUCT[Product] ),
KEEPFILTERS (
INDEX (
1,
FILTER ( ALL ( DIM_PRODUCT[Product] ), [Reviews Volume:] > 5 ),
ORDERBY ( [Avg. Rating:], DESC, [Reviews Volume:], DESC )
)
)
)
Thank you, it seems to be working! Can you please recommend how I would need to update/rework my Top #2 Ranked Product measure? I understand I would need to update the first part based on the logic you shared, however, it doesn't work with that part of my measure that is highlighted in amber colour
Hi,
I am not sure if I understood your question correctly, but please try something like below.
Top 2 Rated Product KPI: =
CALCULATE (
MAX ( DIM_PRODUCT[Product] ),
KEEPFILTERS (
INDEX (
2,
FILTER ( ALL ( DIM_PRODUCT[Product] ), [Reviews Volume:] > 5 ),
ORDERBY ( [Avg. Rating:], DESC, [Reviews Volume:], DESC )
)
)
)
Hi, I was wondering if you had any thoughts on the issue with the measure you suggested? Thanks!
Hi,
Please provide the sample pbix file, and then I can try to look into it.
Thank you.
Thank you again for your help - upon testing both Top 1 and Top 2 Rated Product KPI measures I discovered there are some instances when they are not working as intended. I'll give 2 examples:
Example #1
This is my current full table of top rated products with reviews volume > 5, sorted by descending Avg Rating
Product | Avg. Rating | Reviews |
Product A | 4.75 | 24 |
Product B | 4.67 | 12 |
Product C | 4.19 | 16 |
Other Products |
So, I want my Top Rated Product KPI to return product A, Top #2 Rated Product KPI to return product B, Top #3 Rated Product KPI to return product C (for top #3 measure I used the same logic as you suggested for #2 product).
As a result, Top #1 and #3 KPIs return relevant products, while Top #2 returns Blank, I imagine this might be because its Reviews volume is lower than for Product C.
Example #2
This is another example of the full table of top rated products with reviews volume > 5 sorted by desc Avg Rating for a different market
Product | Avg. Rating | Reviews |
Product A | 4.17 | 8 |
Product B | 3.68 | 19 |
Product C | 3.63 | 9 |
Other Products |
As such, Top #1 KPI returns Blank, Top #2 KPI returns Product B (correct), Top #3 KPI returns Product C (correct).
Do you know why the measures are not working as intended and if so, how would they need to be changed?
Thanks!
User | Count |
---|---|
15 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
13 | |
13 | |
8 | |
8 |