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
SteelChampzz
Helper II
Helper II

Creating a measure for Working Days with "Holiday Dates"

I have a Calendar that I've created in DAX and I want to create a column that shows "Is A Working Day"

0=Not a working day
1=Is A Working Day

I want to create a variable calculation where I can include a "Conditional If statement" including Dates in the measure to return "0" for those dates that are holidays.
Example:

5/30/2022 = 0

7/4/2022 = 0

This is how my calendar is laid out

SteelChampzz_0-1666190587678.png

And this is my measure for "IsWorkingDay"

SteelChampzz_1-1666190626262.png

I feel that I can turn this measure into variables where I can have both "IsWorkingDay" measure and the "IF statement" to create my column.

I'm still very new to creating DAX measure but I'm slowly picking it up.
The help would be greatly appreciated 

1 ACCEPTED SOLUTION
v-mengzhu-msft
Community Support
Community Support

Hi @SteelChampzz ,

 

Like this?

vmengzhumsft_0-1666257208728.pngvmengzhumsft_1-1666257233411.png

Try this measure:

isworkingday = IF(SELECTEDVALUE('Table'[dayname])="Sat"||SELECTEDVALUE('Table'[dayname])="Sun",0,1)

 

Best regards,

Community Support Team Selina zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
v-mengzhu-msft
Community Support
Community Support

Hi @SteelChampzz ,

 

Like this?

vmengzhumsft_0-1666257208728.pngvmengzhumsft_1-1666257233411.png

Try this measure:

isworkingday = IF(SELECTEDVALUE('Table'[dayname])="Sat"||SELECTEDVALUE('Table'[dayname])="Sun",0,1)

 

Best regards,

Community Support Team Selina zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

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.

Top Solution Authors