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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Calculate work days elapsed for all rows of my data?


I created a working days table that identifies each day of the year 2021 as a working day or not using @amitchandak's example here from 2020

 

Here's what my date table now looks like:

jsauerla_2-1613650432040.png

 

My objective is to create a measure that calculates the number of working days elapsed from one date, to the current date. Here's an example below of what I'm trying to achieve

 

Latest Submission Date is my data, that I need to subtract from the current date, but only counting working days

 

Latest Submission Date            New measure here: working days elapsed
1/20/2021??
1/21/2021??
1/22/2021??
1/23/2021??
1/19/2021??
1/1/2021??
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Based on your description, you can create a measure as follows.

working days elapsed =
VAR x1 =
FILTER (
ALL ( 'calendar' ),
[Date] <= TODAY ()
&& [Date] >= SELECTEDVALUE ( 'Submit'[Latest Submission Date ] )
&& WEEKDAY ( [Date], 2 ) < 6
)
RETURN
COUNTROWS ( x1 )

 

Today is 2/22/2021.

Result:

v-yuaj-msft_0-1613972617542.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Based on your description, you can create a measure as follows.

working days elapsed =
VAR x1 =
FILTER (
ALL ( 'calendar' ),
[Date] <= TODAY ()
&& [Date] >= SELECTEDVALUE ( 'Submit'[Latest Submission Date ] )
&& WEEKDAY ( [Date], 2 ) < 6
)
RETURN
COUNTROWS ( x1 )

 

Today is 2/22/2021.

Result:

v-yuaj-msft_0-1613972617542.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

 

amitchandak
Super User
Super User

@Anonymous , Try a new measure


Work Day = COUNTROWS(FILTER(ADDCOLUMNS(CALENDAR(max(Table[Latest Submission Date]),TODAY()),"WorkDay", if(WEEKDAY([Date],2) <6,1,0)),[WorkDay] =1))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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