Forum Discussion
Show Bottom 5 Custoomer
- 4 years ago
dokat , Change second have two measures
Rank = RANKX(ALLSELECTED('P&L'[Customer]),('P&L'[W.Trade/NS Shr]),,ASC)
Only 5= sumx(filter(Values('P&L'[Customer]) ,[Rank]<=5) ,[W.Trade/NS Shr])
Hope the bottom five are not all 0
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. - 4 years ago
Hi,
I am not sure how your data model looks like, but I tried to create a sample pbix file like the attached file.
In my attached file, I think your measure is working correctly.
But, I added one more measure and please try to apply it to your model and please check if it works.
I assume your measure shows blank when you put it into the card visualization? Because your measure does not show total value but only shows individual customer's value.
Expected outcome ver2: = CALCULATE ( [W.Trade/NS Shr], KEEPFILTERS ( TOPN ( 5, ALLSELECTED ( 'P&L'[Customer] ), [W.Trade/NS Shr], ASC ) ) )
amitchandak Thank you for your response. I tried both codes bfirst one returned blank values second one returned [W.Trade/NS Shr] values for all customers. Not just the 5. Not sure what's causing it
dokat , Change second have two measures
Rank = RANKX(ALLSELECTED('P&L'[Customer]),('P&L'[W.Trade/NS Shr]),,ASC)
Only 5= sumx(filter(Values('P&L'[Customer]) ,[Rank]<=5) ,[W.Trade/NS Shr])
Hope the bottom five are not all 0
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- dokat4 years agoPost Prodigy
amitchandak Thanks for your reply. I created rank measure then the second measure. However it is not narrowing down the list to bottom 5. Please see below screenshot. Thanks
- dokat4 years agoPost Prodigy
amitchandak It appears Rank is not returning correct values. Please see below. There are two many customers rank 1. Some of the values are 0.09,0.15 and so on. Would that make a difference?