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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Preeti123
Frequent Visitor

Power BI Calculate Working Days For Every Month Dynamically

Hi Community Members,

 

Since I am new to Power BI, I don't know much about it, though I am learning. I have a simple requirement where I need to use Power BI DAX to display the current working day number out of the overall working day number and that should appear dynamically every month.

For example, 2020 April month has a total of 22 working days. And suppose today is the 20th working day out of 22days. So in Power BI Report, I need to display it as 20 of 22 days. Furthermore, I need to display "As of April 28, 2020" above it (Using DAX only and this one should likewise alter dynamically). Refer to the screenshot link below:

Power-BI-Calculate-Working-Days-Dynamically 

 

Can anyone please help me out to achieve this? Thanks in Advance!!

1 REPLY 1
PaulOlding
Solution Sage
Solution Sage

Hi @Preeti123 

You could use the NETWORKDAYS function to do this.

Work Day = 
VAR _Today = TODAY()
VAR _WorkDaysInMonth = NETWORKDAYS (EOMONTH (_Today, -1) + 1, EOMONTH (_Today, 0))
VAR _WorkDayToday = NETWORKDAYS (EOMONTH (_Today, -1) + 1, _Today)
VAR _Result = _WorkDayToday & " of " & _WorkDaysInMonth & " days"
RETURN
    _Result
As Of Date = 
VAR _Today = TODAY()
VAR _Result = "As of " & FORMAT(_Today, "mmmm d, yyyy")
RETURN
    _Result

Note this uses the TODAY() function to get today's date.  One extension yuou might want to do is base it on the last time the data was refreshed, rather than assume it's updated successfully today.  You can use M function DateTime.LocalNow() in a new query in Power Query to get that.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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