Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Solved! Go to Solution.
@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
@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
ohhh!It's all right!Thanks for your help.
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |