Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Ranking on fixed date sum

Hi,

 

I have made the following measure for ranking, depending on my TopN slicer it gives me a ranking of sales data by brand name, but always includes an "Other" sum.

However this ranking is based on a choosen time frame and works just with one, but I would like to create a table with multiple time columns like Full year, YTD, Month etc.

Is it possible to have this ranking formula to be fixed on for example the YTD time frame? And do I have to make a seperate YTD measure to include it in the formula?

 

ranking =
VAR ProductsToRank = [Waarde van TopN]
VAR Ranking =
rankx( allselected( 'Brand names'[Brand]), 'Sales Data'[Sales amount])
VAR IsotherSelected = SELECTEDVALUE('Brand names'[Brand]) = "Others"
VAR Result = IF(IsotherSelected, ProductsToRank +1,
IF ( Ranking <= ProductsToRank, Ranking, Ranking + 1) )
Return
 Result

2 Replies