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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Rody
Frequent Visitor

Count number of working days current month

Hi all,

 

I am trying the build a sales report and for one metric I would like to show the average tonnes sold per day. In order to do this, I need to embed a dynamic calculation in my calendar table that count the amount of working days (mon-fri) past in the current month. This calculation needs to reset itself every single month. On top of that, I would like to save the total working days in the month when the month has completed.

I cannot wrap my head around this and hope that one of you can help me out.

 

Thanks

Screenshot 2022-08-15 161438.png

1 ACCEPTED SOLUTION
daXtreme
Solution Sage
Solution Sage

 

[# Working Days] = // calculated column
var Today_ = TODAY()
var CurrentMonth = 'Calendar'[Year-Month]
var Result = 
    SUMX(
        filter(
            'Calendar'
            // This filters to the whole month that
            // is on the current line.
            'Calendar'[Year-Month] = CurrentMonth
            // This one says not to count anything
            // that is in the future.
            && 'Calendar'[Date] <= Today_
        ),
        'Calendar'[Is working day]
    )
RETURN
    // Add 0 to Result if you want to see
    // 0 instead of BLANKS.
    Result

 

View solution in original post

2 REPLIES 2
Rody
Frequent Visitor

Fantastic! That did the job. Thanks heaps

daXtreme
Solution Sage
Solution Sage

 

[# Working Days] = // calculated column
var Today_ = TODAY()
var CurrentMonth = 'Calendar'[Year-Month]
var Result = 
    SUMX(
        filter(
            'Calendar'
            // This filters to the whole month that
            // is on the current line.
            'Calendar'[Year-Month] = CurrentMonth
            // This one says not to count anything
            // that is in the future.
            && 'Calendar'[Date] <= Today_
        ),
        'Calendar'[Is working day]
    )
RETURN
    // Add 0 to Result if you want to see
    // 0 instead of BLANKS.
    Result

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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