Forum Discussion
display Rank on a Card visualization
I have a measure that gives the rank of a store, based on its sales against other stores.
I want to just display two pieces of info, the currently selected stores rank & the total number of stores.
I can display the rank in a table with all stores showing, but if i try to do it in a card, or just selecting my single store, i get a rank of 1.
Is it even possible to display a specific rank on a card?
Currently the only thing i can think of is storing the rank in a calc column but this is just not dynamic enough.
Hi wilson_smyth,
I don't know how you are calculating your ranking but I ussually use one specific column to rank the values that I need to filter/slice them and them I can use it to have my ranking.
I have created a simple table with Store and Sales then added two measures:
NORMAL_RANK = RANKX( ALLSELECTED(Sales[Store]); CALCULATE( SUM(Sales[Sales]) ) )
This first measure interacts with the slicers/filter I introduce in the report so it's dinamic and my rank will be influenced by taking out stores from my visual or adding them
OVERALL_RANK = RANKX( ALL(Sales[Store]); CALCULATE( SUM(Sales[Sales]) ) )
In this measure using the ALL function no matter how I have my data sliced it will give me the complete ranking of the store so you can use it in your cards see print below. However using this one if you select more than one value in your slicer in your cards it will give you the first value so be aware of that limitation.
Regards,
MFelix
Apologies, should have responded sooner.
Yes, I found a solution, its pretty much what MFelix suggested.
I was trying to use one calcuation to do two things:- show the rankof all stores
- show just the rank of the selected score on a card.
The problem was that if i got a calculation to show the list rank, it always displayed a value of 1 when placed on a card, and if i got the correct calculation to show the rank on a card, it wouldnt show the ranked list. so 2 calculations were created.
Store Ranking Table = RANKX(ALL('Table'[Store]), CALCULATE([Score]),,0,Dense)
Individual Store Rank = RANKX(ALL('Table'[Store]), CALCULATE([Score], ALLSELECTED('Table'[Store])),,0,Dense)
14 Replies
- MFelixSuper User
Hi wilson_smyth,
I don't know how you are calculating your ranking but I ussually use one specific column to rank the values that I need to filter/slice them and them I can use it to have my ranking.
I have created a simple table with Store and Sales then added two measures:
NORMAL_RANK = RANKX( ALLSELECTED(Sales[Store]); CALCULATE( SUM(Sales[Sales]) ) )
This first measure interacts with the slicers/filter I introduce in the report so it's dinamic and my rank will be influenced by taking out stores from my visual or adding them
OVERALL_RANK = RANKX( ALL(Sales[Store]); CALCULATE( SUM(Sales[Sales]) ) )
In this measure using the ALL function no matter how I have my data sliced it will give me the complete ranking of the store so you can use it in your cards see print below. However using this one if you select more than one value in your slicer in your cards it will give you the first value so be aware of that limitation.
Regards,
MFelix
- AnonymousNot applicablethanks.RANKX(ALL(DimProvider),[ActualValue_CRM] )the above dax formula works fine, but i need the order of the rank to be ASC.[ActualValue_CRM] is a measure.
- MFelixSuper User
Hi Anonymous ,
The 4rd parameter of the RANKX is the order you just need to do your measure like this:
RANKX(ALL(DimProvider),[ActualValue_CRM],, ASC )
- nardtmoHelper III
Hi Mfelix,
Thanks in advance. Having issue with ranking ranking starting with 2 after adding row (region). i tried adding isinscope in the formula but ranking is still wrong. thanks
output: ranking of market selected inside a card in nation and northeast
example NY rank 8 in nation & in NE rank in 5
RANK =if(isinscope(data3[MARKET]),RANKX (ALLSELECTED(data3[MARKET]),[round_values], , ASC, Dense))overall_rank = RANKX(All(data3[MARKET]),[round_values], ,ASC, Dense)my data:MARKET Sum of 7Days_Rolling_sale_Per_Market REGION Las Vegas 0.3855 WEST Albuquerque 0.3692 WEST Hawaii 0.3565 WEST San Francisco 0.3452 WEST San Diego 0.3434 WEST Los Angeles 0.3341 WEST LA North 0.3305 WEST Southern California 0.3268 WEST Long Island 0.2753 NORTHEAST Orlando 0.2701 SOUTH Salt Lake City 0.2629 WEST Washington DC 0.2627 NORTHEAST Sacramento 0.2614 WEST New York 0.2575 NORTHEAST Upstate NY 0.2453 NORTHEAST New Jersey 0.2407 NORTHEAST Miami 0.239 SOUTH New England 0.238 NORTHEAST Philadelphia 0.2358 NORTHEAST Virginia 0.2356 NORTHEAST Connecticut 0.2329 NORTHEAST Jacksonville 0.2176 SOUTH Tampa 0.2132 SOUTH South Carolina 0.2104 NORTHEAST North Carolina 0.2069 NORTHEAST Central PA 0.1933 NORTHEAST
- v-yulgu-msftMicrosoft Employee
Hi wilson_smyth,
Have you resolved your problem? Was MFelix's suggestion helpful to your scenario? If yes, please kindly mark the corresponding reply as an answer so that some more people having similar concern can find the solution more easily. If you still have any question, please feel free to ask.
Best regards,
Yuliana Gu- wilson_smythPost Patron
Apologies, should have responded sooner.
Yes, I found a solution, its pretty much what MFelix suggested.
I was trying to use one calcuation to do two things:- show the rankof all stores
- show just the rank of the selected score on a card.
The problem was that if i got a calculation to show the list rank, it always displayed a value of 1 when placed on a card, and if i got the correct calculation to show the rank on a card, it wouldnt show the ranked list. so 2 calculations were created.
Store Ranking Table = RANKX(ALL('Table'[Store]), CALCULATE([Score]),,0,Dense)
Individual Store Rank = RANKX(ALL('Table'[Store]), CALCULATE([Score], ALLSELECTED('Table'[Store])),,0,Dense)
- wilson_smythPost Patron
Quick update - Although the solution worked if using a table and a card, if i try to use either rank measure as the circle size on a , map, they all come out as 1.
I think theres some filter context im not understanding, but would appreciate any advice.