Home > front end >  Power BI - Getting invalid date ranges when creating a date table in DAX
Power BI - Getting invalid date ranges when creating a date table in DAX

Time:12-19

I'm trying to create a Date table in Power BI using DAX. The formula I used is:

Date = ADDCOLUMNS( CALENDAR("1/1/1994","12/31/2024"),
        "Year", YEAR([Date]),
        "Month Number", MONTH([Date]),
        "Month", FORMAT([Date],"mmmm"),
        "Quarter", FORMAT([Date],"\QQ")    
        )

So Calendar function has 2 arguments, start date and end date. You can see above that the start date is 1/1/1994 and the end date is 12/31/2024. However, when I look at the results of the data table, the start date is 7/1/1994 and the end date is 1/31/2023.

Can someone please tell me what I'm doing wrong?

Thank you,

enter image description here

CodePudding user response:

Click the dropdown of the Date column and then Sort ascending

enter image description here

  • Related