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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
christianfcbmx
Post Patron
Post Patron

Help with Calendar: I need to mark as False weekends and holidays

Good day and good after noon teachers !!! 1 big hand with a calendar table please!... I need to make holidays "False" in the same column (Workdays)... as you see I have only weekends as False at the moment... any advice according with what I have? (I have to keep it like this with 2 columns "Date" and "Workdays") Thank you in advance community. 

 

WorkDay =
VAR WeekDayNum =
WEEKDAY ( 'Calendar'[Date], 2 )
RETURN
(
IF ( WeekDayNum = 6 || WeekDayNum = 7,,FALSE(),TRUE() ))

 

 

Calendar.JPG

2 ACCEPTED SOLUTIONS
Phil_Seamark
Employee
Employee

You'll need a data source of holidays.  These will vary from region to region, organisation to organisation.  Once you have the list that is relevant for your reports, import it as a table.  You can then merge the details into a new column in your Date table or extend the logic of your existing column.  

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

Hi Phil... I did what you said and this look like this: I made a holiday table then, over my calendar table, I added the holiday column with a "Related column function" ...after that, I added another column with "IF" function as you see in the pic... I think it worked but Im not sure if that if what you meant.

 

Thanks in advance for your feedback.Calendar2.JPG

View solution in original post

4 REPLIES 4
Phil_Seamark
Employee
Employee

You'll need a data source of holidays.  These will vary from region to region, organisation to organisation.  Once you have the list that is relevant for your reports, import it as a table.  You can then merge the details into a new column in your Date table or extend the logic of your existing column.  

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi Phil... I did what you said and this look like this: I made a holiday table then, over my calendar table, I added the holiday column with a "Related column function" ...after that, I added another column with "IF" function as you see in the pic... I think it worked but Im not sure if that if what you meant.

 

Thanks in advance for your feedback.Calendar2.JPG

Hi @christianfcbmx

 

It looks good.  But do you want your new column to say True (when it's a weekend or holiday) and False (for everything else) ?

 

If so add this column

 

Is Workday = IF('Calendar'[Workday] || 'Calendar'[Workday (1)],FALSE(),TRUE())

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Vice versa Phil... False when is weekend and holiday and as you can see is done...the logic is very simple ..it is what I needed. Thank you Phil to light my way to the solution!!!!

 

 

 

Imagen1.jpg.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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