Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Calculating Total N per Year & Ranking per year

Hello!

 

I am trying to rank selected reasons and show % from the total N. I am having issues from the current measure i created as the dataset have multiple years of the data. 

 

Below is what I have so far:

 

Reasons Count Total N =
If(HASONEVALUE('Historical'[ReasonName]),
[Reasons Count],
CALCULATE([Reasons Count],ALL('Historical'[ReasonName])))
 
Reason Ranking =
RANKX(ALL('Historical'[ReasonName]),[Reasons Count],,0)
 
I tried to add year in the reasons count measure but throws off Total N when slicers are applied.
 
Thank you in advance for your help!!

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    amitchandak 

     

    Thank you for your reply! I tried- but now it is pulling records that shouldn't pull..

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Please update the formula of your measure [Reason Ranking] as below and check whether it can get the correct result...

    Reason Ranking = RANKX(ALLSELECTED('Historical'[ReasonName]),[Reasons Count],,0)

    If the above one is not working, please provide some sample data(exclude sensitive data) and your expected result with backend logic and special examples. Thank you.

    Best Regards

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem with you. Thank you.

    Best Regards