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.
I created a calendar using DAX.
For instance for value 3-1-2021 i get week 53 using underneath DAX formula
Solved! Go to Solution.
Hey @Spiedo ,
you could check when the month = 1 and the WEEKNUM > 50 then you should use year - 1, otherwise year.
Do you want to use it as a calculated column or as a measure?
I am in a similar situation, but I need to calculate the first day of the ISO year with the week starting on Sunday. For example (in Month/Day/Year):
The first day of the ISO year 2016 = 12/27/2015
The first day of the ISO year 2017 = 12/25/2016
The first day of the ISO year 2018 = 12/31/2017
etc.
I have calculated the ISO year, and the ISO weeks (i.e. if WEEKNUM = 53, then count it as the first week of the following year), but any of the MIN or MINX functions that I have tried to calculate the first day of the ISO year are only brining back the first day of the year for the first ISO year (i.e. 12/27/2015 is being returned for all years as the first ISO date of the year).
Hey @Spiedo ,
you could check when the month = 1 and the WEEKNUM > 50 then you should use year - 1, otherwise year.
Do you want to use it as a calculated column or as a measure?
Hi Everyone,
i am preparing a new calander table in my power bi model,
Please could you advise me as how to calculate "ISO Date" in any calender in power BI. i really need this column, please help me.
Thank you. I was trying to implement it but the ADDCOLUMNS( ) does not seem to appreciate the IF statement. It seems like a column under the hood of ADDCOLUMNS() can't be an IF statement because i retyped it into a very simple IF statement first. Nevertheless i believe this workaround will help
Hey @Spiedo ,
it should also be possible with ADDCOLUMN. Can you share your measure?
Best regards
Denis
Hey @Spiedo ,
try the following approach:
Kalender =
ADDCOLUMNS(
CALENDAR (MIN(vCheckin_SupportCallList[Opened]), Now()),
"DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ),
"Year", YEAR ( [Date] ),
"Monthnumber", FORMAT ( [Date], "MM" ),
"Weeknumber", FORMAT(WEEKNUM ([Date],21),00),
"YearWeeknumber", FORMAT ([Date], "YYYY" ) & "/" & FORMAT(WEEKNUM ([Date],21), "00"),
"YearMonthnumber", FORMAT ( [Date], "YYYY/MM" ),
"YearWeeknumber_New",
SWITCH(TRUE(),
MONTH([Date]) = 1 && WEEKNUM ([Date],21) > 50, YEAR([Date]) -1,
MONTH([Date]) = 12 && WEEKNUM ([Date],21) = 1, YEAR([Date])+1,
YEAR([Date])
) & "/" & FORMAT(WEEKNUM ([Date],21), "00")
)
This will give you the new year if week is week 1 in the old year:
And also it will show you the old year when the week is the number of the old year:
Good morning
what do you mean by "vCheckin_SupportCallList[Opened]" ??
Best regards
That is the name of a database view containing many fields, also date fields
Thank you very much!
BTW:
This also solves the first week of the year if it is in the previous year, thank for this extra tweak!
Quite special there is no ISO year while an ISO week is available
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |