Forum Discussion
Need Help about RANKX when using in measure, it always return 1
Hi experts,
I found an error when using RANKX as measure in my model, it always return 1.
There are 2 tables in my model, one is calendar and another is transaction records with transaction date. In addition, I build relationship between calendar date and transaction date.
For rank of how much time has elapsed since a customer’s last transaction, I created several measures:
Measure 1: Current Calendar Date
Current Calendar Date = MAX('Calendar'[Date])
Measure 2: Current Transaction Date
Measure 3:Days
Days =SWITCH (TRUE (),LEN ( [Current Transaction Date] ) = 0, 0,VALUE ( [Current Calendar Date] - [Current Transaction Date] ))
Measure 4:Days-Rank
Days-Rank = RANKX(ALLSELECTED('Summarize-RFM'),CALCULATE([Days]))
File share link:https://1drv.ms/u/s!AqpJKo3pWwgIgYMdswp672vyC2ijKQ?e=q3ORrx
I searched almost all Internet, but no one article could fix this issue, would you mind help me check the model?
Hope your reply!
Thanks
Anonymous , Assuming all others are measure in the table, try like
Days-Rank = RANKX(ALLSELECTED('Summarize-RFM'[customer No]),[Days])
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
2 Replies
- amitchandakSuper User
Anonymous , Assuming all others are measure in the table, try like
Days-Rank = RANKX(ALLSELECTED('Summarize-RFM'[customer No]),[Days])
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures- AnonymousNot applicable
ohhh!It's all right!Thanks for your help.