The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Been trying to combine the visual for drill down where it will display aggregate according to Year, Month then StartofWeek - Given startofweek is Monday.
VAR MaxValidToDate = MAX(WF_weekly[Ticket created - Date])
VAR MinValidToDate = MIN(WF_weekly[Ticket created - Date])
VAR _calendar =
CALENDAR(MinValidToDate, MaxValidToDate)
RETURN
ADDCOLUMNS(
_calendar,
"Year", YEAR([Date]),
"Week", "Week " & WEEKNUM([Date] - WEEKDAY([Date], 2) + 1, 2),
"WeekNumber", WEEKNUM([Date] - WEEKDAY([Date], 2) + 1, 2),
// Calculate the start and end of the week
"StartOfWeek", [Date] - WEEKDAY([Date], 2) + 1,
"EndOfWeek", [Date] - WEEKDAY([Date], 2) + 7,
// Calculate date range as week start to week end
"Date Range",
FORMAT([Date] - WEEKDAY([Date], 2) + 1, "MMM dd") & " - " & FORMAT([Date] - WEEKDAY([Date], 2) + 7, "MMM dd"),
"MonthNumber", MONTH([Date]),
"Month", FORMAT([Date], "mmm"),
"Quarter", "QTR " & FORMAT([Date], "Q"),
"QuarterNumber", FORMAT([Date], "Q"),
"MonthYearNumber", FORMAT([Date], "yy mm"),
"Month Year", FORMAT([Date], "mmm yyyy")
It splits when the week is between two months.
How do i create the relation for the drill down to work?
You can calculate a new column called Month Adjusted that assigns all dates in a given week to the month in which the week begins:
Is it possible to drill back up to the month level, where it will not calculate the result correctly. The target outcome is the bottom, where it considers 1Feb - 3Feb into February month.
Top - USING MonthAdjusted, Bottom - Using Calendar Month
I didn't get it, Jan 29 - Feb 04 should be part of Jan only?
Yes. ideally as to follow the startofweek . So that the weeks doesnt duplicate. This below is using StartofWeek hierarchy, which works when it is drilled down to weeks, but when i drill up to Month, I need it by Calendar Month and not StartofWeek Month.