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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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

Top Kudoed Authors