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
NB3
Helper III
Helper III

DAX (Number X / Total weekdays MTD )* Total weekdays in Month

Hello everyone,

 

I have this formula in Excel update Daily that I'd like to move into Power BI. I don't know if there is a formula that could do this calculation automatically and if this is even possible.

 

Here is what I need - Each month we have:

- an actual Number = X

- a target number = Y

- total weekdays MTD (minus the holidays - Canadian Calendar) = 9 (since today is the ninth weekday of the month - we had a holiday on Monday 7th of September not included) 

- total weekdays in month = 21 (21 weekdays in September - not including the holiday on the 7th)

 

The formula we use is: (X/9)*21/Y

 

Is there any formula that would calculate automatically the number 9 (that would update each day) and number 21 (that would update monthly) excluding the weekends and holidays?

 

I hope this makes sense,

 

Thanks in advance for you help,

 

Nick

 

1 REPLY 1
amitchandak
Super User
Super User

@NB3 , not very clear

You can have a working day in the date table

 

Work Date = if(WEEKDAY([Date],2)>=6,BLANK(),[Date])


Work Day This month = if('Date'[Work Day]=1,sumx(filter('Date',[Month Year]=EARLIER('Date'[Month Year]) && [Date]<=EARLIER('Date'[Date]) ),[Work Day]),BLANK())

 

Hope those can help

 

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.