The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
76 | |
66 | |
52 | |
52 |
User | Count |
---|---|
127 | |
116 | |
78 | |
64 | |
63 |