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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.