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

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
v-yuaj-msft
Community Support
Community Support

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
v-yuaj-msft
Community Support
Community Support

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))

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.