The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have a dax calendar with the following elements :
And I would like to add a month ID column that would give me a relative ranking based on the current month (current month is 0).
I know how to use rank but not with a specific value as a start.
2021-11 | -4 |
2021-12 | -3 |
2022-01 | -2 |
2022-02 | -1 |
2022-03 | 0 |
2022-04 | 1 |
2022-05 | 2 |
Thank you
Have a nice day
Jack
Solved! Go to Solution.
add a new column to your calendar definition
"Ranking",
var yearMonInt = INT( FORMAT( [Date], "YYYYMM"))
var todayInt = INT( FORMAT( TODAY(), "YYYYMM"))
return yearMonInt - todayInt
add a new column to your calendar definition
"Ranking",
var yearMonInt = INT( FORMAT( [Date], "YYYYMM"))
var todayInt = INT( FORMAT( TODAY(), "YYYYMM"))
return yearMonInt - todayInt
Thank you so much! It definitely does the job 🙂
User | Count |
---|---|
10 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
20 | |
15 | |
14 | |
10 | |
7 |