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

Top Solution Authors