Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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 |
---|---|
9 | |
8 | |
5 | |
4 | |
3 |