Hi,
I create a new Date table with DAX using the CALENDAR() function.
Adding new columns, no problem. When I add a new "Quarter" colum into the table my table stops starting from Jan 1st and move to start from Jul 1st.
I can't understand why. Any help greatly appreciated.
First Variant (correct)
Date =
VAR MinDate = DATE(2016,1,1)
VAR MaxDate = DATE(2021,12,31)
RETURN
ADDCOLUMNS (
CALENDAR(MinDate, MaxDate),
"Calendar Year", "CY " & YEAR ([Date])
)
Result
Second Variant (wrong)
Date =
VAR MinDate = DATE(2016,1,1)
VAR MaxDate = DATE(2021,12,31)
RETURN
ADDCOLUMNS (
CALENDAR(MinDate, MaxDate),
"Calendar Year", "CY " & YEAR ([Date]),
"Calendar Quarter", "CQ " & QUARTER([Date])
)
Result
Where I am wrong?
Thanks
Solved! Go to Solution.
Hi, @maclura , no worries, those other before July are not gone with the wind; but the mechnism under the hood is not clear.
Hi, @maclura , no worries, those other before July are not gone with the wind; but the mechnism under the hood is not clear.
Thank you @CNENFRNL .
If I was a little more savvy, I would have to get there on my own. But I agree with you, why generated dates are sorted in that way?
After some other tests, I think it should be something related to a chaching mechanism.
In fact, sorting issues happen not only with rows, but also with columns, when you add more columns into the formula. The new columns are created regardless of their position in the formula.
If you create a new date table, when you run the formula the first time, columns are created in the order they appear into the formula.
Check out new user group experience and if you are a leader please create your group
100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.