Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
KRISH80
Helper II
Helper II

Help with Calendar marking weekend

Dear All,

I have below code to generate dynamic calendar which also gives weekends and weekdays. But i don't know how to tweak this code to Mark certian dates as Holidays. For eg - 25th Dec, 1st Jan etc... can anyone help me ?

 

Calendar =
ADDCOLUMNS (
CALENDARAUTO ( 3 ),
"MIndex", MONTH ( EDATE ( [Date], -3 ) ),
"CalMonth", FORMAT ( [Date], "mmm" ),
"CalQtr", "Q"
& CEILING ( MONTH ( [Date] ), 3 ) / 3,
"CalYear", YEAR ( [Date] ),
"FinQtr", "Q"
& CEILING ( MONTH ( EDATE ( [Date], -3 ) ), 3 ) / 3,
"FY",
VAR CY =
RIGHT ( YEAR ( [Date] ), 2 )
VAR NY =
RIGHT ( YEAR ( [Date] ) + 1, 2 )
VAR PY =
RIGHT ( YEAR ( [Date] ) - 1, 2 )
VAR FinYear =
IF ( MONTH ( [Date] ) > 3, CY & "-" & NY, PY & "-" & CY )
RETURN
FinYear,
"FinWeekNo", WEEKNUM ( EDATE ( [Date], -3 ), 2 ),
"CalWeekNo", WEEKNUM ( [Date], 2 ),
"Weekend/Working", IF ( WEEKDAY ( [Date], 2 ) > 5, "Weekend", "Working" ),
"Day", FORMAT ( [Date], "ddd" ),
"CustomDate", FORMAT ( [Date], "d/mm" )
)
1 REPLY 1
az38
Community Champion
Community Champion

Hi @KRISH80 

you need to upload into model another business-calendar with holidays.

it could be calendar from your data storage or third-party, but there is no such built-in option in power bi 

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.