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
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
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.