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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.