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
thampton
Helper III
Helper III

Running Total By Month on Date Table

Hello - I have seen many answers to this questions but none seem to work in my situation. I have a date table (date, day, month, etc) and a column showing business days. I would like to have a MTD business days calculation that is a running total up to the current day and starting over at the beginning of each month. Should

 

Date          Business Days    Running Total
Jan 1                   1                     1

Jan 2                   1                     2

Jan 3                   1                     3

....

Feb 1                   1                     1

 

 

Any thoughts?

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @thampton  ,

According to your description, I create this data from 2021.1.1-2021.2.28:

v-yangliu-msft_0-1614317097740.png

Here are the steps you can follow:

1. Create calculated table.

Business Day =
var _weekday=WEEKDAY('Table'[date])
return
IF(OR(_weekday=6,_weekday=7),0,1)
running total =
CALCULATE(SUM('Table'[Business Day]),FILTER('Table','Table'[Business Day]=1&&'Table'[Month]=EARLIER('Table'[Month])&&'Table'[date]<=TODAY()))

2. Result.

v-yangliu-msft_1-1614317097745.png


You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @thampton  ,

According to your description, I create this data from 2021.1.1-2021.2.28:

v-yangliu-msft_0-1614317097740.png

Here are the steps you can follow:

1. Create calculated table.

Business Day =
var _weekday=WEEKDAY('Table'[date])
return
IF(OR(_weekday=6,_weekday=7),0,1)
running total =
CALCULATE(SUM('Table'[Business Day]),FILTER('Table','Table'[Business Day]=1&&'Table'[Month]=EARLIER('Table'[Month])&&'Table'[date]<=TODAY()))

2. Result.

v-yangliu-msft_1-1614317097745.png


You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.