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
Anonymous
Not applicable

How to get monthly sum through current date?

I have a calendar table that runs through 2025, and I want to sum the number of business days for all previous months up until the present day in December. How can I write a formula to do this?

 

=
MAXX(
KEEPFILTERS(VALUES('date'[date])),
CALCULATE(SUM('Date'[Business Days Passed]),filter('date','date'[date]=today()-1)))

 

This only shows the total business days in December so far, and shows it for every month which is not what I want. 

 

I would like

September 21

October 22

November 21

December 8

 

1 ACCEPTED SOLUTION
jthomson
Solution Sage
Solution Sage

I'm guessing given how your formula looks that the Business Days Passed column is something that has a 1 if it is a business day and a 0 if it doesn't - how about making a column that compares the date in your date table and populates it with a 1 or a 0 dependent on whether the date in the date table is before today or not? You could then countrows conditional on both column's status, or, equivalently, do a sumx of multiplying the two columns together?

View solution in original post

2 REPLIES 2
jthomson
Solution Sage
Solution Sage

I'm guessing given how your formula looks that the Business Days Passed column is something that has a 1 if it is a business day and a 0 if it doesn't - how about making a column that compares the date in your date table and populates it with a 1 or a 0 dependent on whether the date in the date table is before today or not? You could then countrows conditional on both column's status, or, equivalently, do a sumx of multiplying the two columns together?

Anonymous
Not applicable

Oh my god you literally saved me from insanity. I have been too far into this problem I was having to even think of something as simple as that. I wish I could give you 10,000 kudos oh my goodness. 

 

 

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.