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
liberty20
Frequent Visitor

Calculate working days for the month when Fri, Sat & Sun should be same number.

Hi all,

Trying to achieve the following output for each month in Power BI.

 

DateDay
01 December 20211
02 December 20212
03 December 20213
04 December 20213
05 December 20213
06 December 20214
07 December 20215
08 December 20216
09 December 20217
10 December 20218
11 December 20218
12 December 20218
13 December 20219
14 December 202110
15 December 202111
16 December 202112
17 December 202113
18 December 202113
19 December 202113
20 December 202114
21 December 202115
22 December 202116
23 December 202117
24 December 202118
25 December 202118
26 December 202118
27 December 202119
28 December 202120
29 December 202121
30 December 202122
31 December 202123
01 January 202223
02 January 202223
03 January 20221
04 January 20222
05 January 20223
06 January 20224

 

Kindly help with the above.

Thank You!

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@liberty20 

I created a calculated column to get the desired results, please check and let me know if it works for you. I have attached a PBIX file below.

 


VAR __DATE1 =    
    COUNTROWS(
        FILTER(           
            DATESMTD('Dates'[Date]),
            WEEKDAY( 'Dates'[Date] , 2) in {1,2,3,4,5}            
        )
    )
VAR __DATE2 =    
    COUNTROWS(
        FILTER(
            PARALLELPERIOD('Dates'[Date], -1 ,MONTH),
            WEEKDAY( 'Dates'[Date] , 2) in {1,2,3,4,5} 
        )
    )
RETURN
COALESCE( __DATE1, __DATE2)

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@liberty20 

I created a calculated column to get the desired results, please check and let me know if it works for you. I have attached a PBIX file below.

 


VAR __DATE1 =    
    COUNTROWS(
        FILTER(           
            DATESMTD('Dates'[Date]),
            WEEKDAY( 'Dates'[Date] , 2) in {1,2,3,4,5}            
        )
    )
VAR __DATE2 =    
    COUNTROWS(
        FILTER(
            PARALLELPERIOD('Dates'[Date], -1 ,MONTH),
            WEEKDAY( 'Dates'[Date] , 2) in {1,2,3,4,5} 
        )
    )
RETURN
COALESCE( __DATE1, __DATE2)

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Fowmy
Super User
Super User

@liberty20 

 

Can you provide more details on the following 

 

1. What's the logic when a new month starts? 
2. What if the 1st date in the table starts on Saturday? Should you start with 1,1,2 ?

3.  Are looking for a DAX Calc column or a measure?

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.