Forum Discussion
Anonymous
5 years agoNot applicable
Earlier function on the fly
Hi all, I'm trying to create rank calculation on PBI. I'm able to do that with earlier function which only allows create on column. When I created on column It is not serve to purpose completely....
- 5 years ago
Hi Anonymous ,
You need to create the following measures, be aware that I'm divinding this in several measure so you can have the calculations checked.
Amount = SUM(PCC_Analysis2[Amount]) Rank_Values = RANKX(ALLSELECTED(PCC_Analysis2[Customer]); CALCULATE([Amount]) + + INT ( CALCULATE ( MIN ( PCC_Analysis2[Customer]) ) ) / 100000) Cumulative Total based on Rank = CALCULATE([Amount]; TOPN([Rank_Values];ALLSELECTED(PCC_Analysis2[Customer]);[Amount] + INT ( CALCULATE ( MIN ( PCC_Analysis2[Customer]) ) ) / 100000 ) ) % of Products Running Total = DIVIDE([Cumulative Total based on Rank];CALCULATE([Amount];ALLSELECTED(PCC_Analysis2[Customer])))The idea here is to pick up the TOPN lines that are equal to the ranking.
Adding the + INT ( CALCULATE ( MIN ( PCC_Analysis2[Customer]) ) ) / 100000 allows to make the equal values to be different.
Be aware that I'm making a relationship between slicer and fact table.
Anonymous Using you PBIX file thanks in advance
Check PBIX file attach.
MFelix
5 years agoSuper User
Hi Anonymous
Try the following measure:
Measure = RANKX( ALLSELECTED( Test[Customer] ) ; CALCULATE( SUM( Test[Amount] ) ) )
Has you see below result is the same for all the data and differs when you select dates: