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
Anonymous
Not applicable

Creating DAX Expression for Targets using Holiday Calendar

I need to create a column within my report that will divide the 'Target Estimate' column values by the number of working days in the month (# of working days minus holidays) and then multiplied by the current working day of the month.

 

For example: today (June 8th) would be (Target Estimate / 21 days) * 5

 - 21 days (22 total work days minus 1 holiday)

 - 5 (5th working day of the month)

 

rfulchi_1-1686258267830.png

 

I have created a calendar table which includes the following columns and a holiday table as well:

rfulchi_0-1686258202335.png

rfulchi_2-1686258458564.png

 

How would I go about creating a DAX expression that will allow for this? All help is appreciated as I am a PowerBI newbie.

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Assume you need a measure and date is in the context

a new measure =

Networkdays(Eomonth(Min(Date[Date]),-1)+1, Max(date[Date]) , 1)

 

to add a holiday code refer

Power BI - Business day with and without using DAX Function NETWORKDAYS: https://www.youtube.com/watch?v=Qs03ZZXXE_c

 

 

https://medium.com/@amitchandak/power-bi-dax-function-networkdays-5c8e4aca38c

 

for column

networkdays(eomonth([Date],-1)+1, [Date],1)

 

 

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.