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.
Hi all,
I want to change my calendar so for some specific weekly calculations my week will start on Friday and end of Thursday.
This is my calendar below.
Which parts will I need to change below?
Solved! Go to Solution.
Hello @Anonymous,
Can you please try the following approach:
VAR __RESULT =
ADDCOLUMNS (
ADDCOLUMNS (
__BASE,
"Year", YEAR ( [Date] ),
"Month Long", FORMAT ( [Date], "mmmm" ),
"Month Short", FORMAT ( [Date], "mmm" ),
"Month Number", MONTH ( [Date] ),
"Month and Year", FORMAT ( [Date], "mmm-yy" ),
"YYYYMM", FORMAT ( [Date], "MMM" ),
"Quarter", "Q" & QUARTER ( [Date] ),
"Day of Week Long", FORMAT ( [Date], "dddd" ),
"Day of Week Short", FORMAT ( [Date], "ddd" ),
"Day Sort", WEEKDAY ( [Date], 1 ),
"Week of Year", WEEKNUM ( [Date], 2 ),
"Week Ending Thursday",
VAR __DAY =
WEEKDAY ( [Date], 2 ) - 7
RETURN
[Date] - __DAY,
"Week Starting Friday",
VAR __DAY =
WEEKDAY ( [Date], 2 )
RETURN
[Date] - __DAY + (7 - __DAY) % 7
),
"Week Starting Thursday", [Week Ending Thursday] - 6
)
RETURN
__RESULT
Hello @Anonymous,
Can you please try the following approach:
VAR __RESULT =
ADDCOLUMNS (
ADDCOLUMNS (
__BASE,
"Year", YEAR ( [Date] ),
"Month Long", FORMAT ( [Date], "mmmm" ),
"Month Short", FORMAT ( [Date], "mmm" ),
"Month Number", MONTH ( [Date] ),
"Month and Year", FORMAT ( [Date], "mmm-yy" ),
"YYYYMM", FORMAT ( [Date], "MMM" ),
"Quarter", "Q" & QUARTER ( [Date] ),
"Day of Week Long", FORMAT ( [Date], "dddd" ),
"Day of Week Short", FORMAT ( [Date], "ddd" ),
"Day Sort", WEEKDAY ( [Date], 1 ),
"Week of Year", WEEKNUM ( [Date], 2 ),
"Week Ending Thursday",
VAR __DAY =
WEEKDAY ( [Date], 2 ) - 7
RETURN
[Date] - __DAY,
"Week Starting Friday",
VAR __DAY =
WEEKDAY ( [Date], 2 )
RETURN
[Date] - __DAY + (7 - __DAY) % 7
),
"Week Starting Thursday", [Week Ending Thursday] - 6
)
RETURN
__RESULT