Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a Calendar Table that I just made in DAX via the CALENDAR function.
I'd like to add an Index column to it - just a 1,2,3,4, etc. Since I made it in DAX, and not Power Query, there's no ready-made way to do this. What would be the easiest way to do it in DAX?
Solved! Go to Solution.
Try the below DAX in New Column.
Row Index Column =
CALCULATE(
COUNTROWS(TCalendar),
FILTER(All(TCalendar), TCalendar[Date] <= EARLIER(TCalendar[Date]))
)
Hope this helps.
If this solves your problem please mark as solution.
Great solution, I want to share all the code and how I managed to index Year/Month:
Try the below DAX in New Column.
Row Index Column =
CALCULATE(
COUNTROWS(TCalendar),
FILTER(All(TCalendar), TCalendar[Date] <= EARLIER(TCalendar[Date]))
)
Hope this helps.
If this solves your problem please mark as solution.
That's a nice way to do it - thanks!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |