Forum Discussion
Conditional Top 20
- 9 years ago
Hi, Please try with this measure:
ProductionShow = IF ( HASONEVALUE ( T_Region[Region] ), [Sum of Production], IF ( COUNTROWS ( INTERSECT ( VALUES ( T_PU[Production Unit] ), TOPN ( 20, ALLSELECTED ( T_PU[Production Unit] ), [Sum of Production], DESC ) ) ) > 0, [Sum of Production], BLANK () ) )Regards
Victor
Lima - Peru
Hi fabo,
In your solution, the right chart is weird, please examined carefully? Do you mind share your sample data for further analysis?
For your right chart, you only find the rows where the rank less than 20, not all the rows. So when you click a region in left chart, it shows the products(were rank <=20) located in the region.
Best Regards,
Angelia
- fabo9 years agoAdvocate III
Thank you for replying, Angelia! :smileyhappy:
Here is a shared folder with my sample data in OneDrive. I hope you can find something useful from it.
I got your explanation about my right chart. I will rethink how I can make it work properly, i.e. showing top 20 only when no region is selected and just filtering otherwise.
fabo
- Vvelarde9 years agoCommunity Champion
Hi, Please try with this measure:
ProductionShow = IF ( HASONEVALUE ( T_Region[Region] ), [Sum of Production], IF ( COUNTROWS ( INTERSECT ( VALUES ( T_PU[Production Unit] ), TOPN ( 20, ALLSELECTED ( T_PU[Production Unit] ), [Sum of Production], DESC ) ) ) > 0, [Sum of Production], BLANK () ) )Regards
Victor
Lima - Peru