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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
joshig
Frequent Visitor

How to obtain Month range from a date column along with cumulative total

I have the following dataset with date , amount and another column Spending. The Spending column can potentially have two values Expenditures and Non Expenditures. And I need to obtain cumulative/Running total based on the amount column corresponding to Date column that should display in the month range.

 

data.jpg

so i need something like below in my table/tablix visualizer from the data above

report.jpg

 

I have already  wrote measures for Expenditures and NonExpenditures

Expenditures= CALCULATE( SUM(AllExpendituresDataFormatted[AMOUNT]),AllExpendituresDataFormatted[SPENDING] = "Expenditure") and is able to represent data 
DateExpendituresNonExpenditures
June 2021121212123232323
July 20212323232323323
 
any help/suggestions/directions would be greatly appreciated.
2 ACCEPTED SOLUTIONS
v-easonf-msft
Community Support
Community Support

Hi, @joshig 

You need enter the following data table which can also be easily created in excel.

62.png

Then try formulas as below:

cumulative amount_Expenditures = 
CALCULATE (
    AllExpendituresDataFormatted[Expenditures],
    FILTER (
        AllExpendituresDataFormatted,
        AllExpendituresDataFormatted[Date] >= SELECTEDVALUE ( 'Table'[Start Date] )
            && AllExpendituresDataFormatted[Date] <= SELECTEDVALUE ( 'Table'[End Date] )
    )
)
cumulative amount_NonExpenditures = 
CALCULATE (
    AllExpendituresDataFormatted[NonExpenditures],
    FILTER (
        AllExpendituresDataFormatted,
        AllExpendituresDataFormatted[Date] >= SELECTEDVALUE ( 'Table'[Start Date] )
            && AllExpendituresDataFormatted[Date] <= SELECTEDVALUE ( 'Table'[End Date] )
    )
)

sample result:

63.png

Best Regards,
Community Support Team _ Eason

View solution in original post

v-easonf-msft
Community Support
Community Support

Hi, @joshig 

Can you tell me if your problem is solved?

If you still need help, please share more information about it.

Best Regards,
Community Support Team _ Eason

View solution in original post

5 REPLIES 5
v-easonf-msft
Community Support
Community Support

Hi, @joshig 

Can you tell me if your problem is solved?

If you still need help, please share more information about it.

Best Regards,
Community Support Team _ Eason

v-easonf-msft
Community Support
Community Support

Hi, @joshig 

You need enter the following data table which can also be easily created in excel.

62.png

Then try formulas as below:

cumulative amount_Expenditures = 
CALCULATE (
    AllExpendituresDataFormatted[Expenditures],
    FILTER (
        AllExpendituresDataFormatted,
        AllExpendituresDataFormatted[Date] >= SELECTEDVALUE ( 'Table'[Start Date] )
            && AllExpendituresDataFormatted[Date] <= SELECTEDVALUE ( 'Table'[End Date] )
    )
)
cumulative amount_NonExpenditures = 
CALCULATE (
    AllExpendituresDataFormatted[NonExpenditures],
    FILTER (
        AllExpendituresDataFormatted,
        AllExpendituresDataFormatted[Date] >= SELECTEDVALUE ( 'Table'[Start Date] )
            && AllExpendituresDataFormatted[Date] <= SELECTEDVALUE ( 'Table'[End Date] )
    )
)

sample result:

63.png

Best Regards,
Community Support Team _ Eason

This is awesome!! Kudos..

amitchandak
Super User
Super User

@joshig , to me it seems like YTD with year start in July

 

Assuming you have measure Expenditures, NonExpenditures with help from date table 

 

YTD Expenditures= CALCULATE([Expenditures],DATESYTD('Date'[Date],"6/30"))

 

YTD NonExpenditures = CALCULATE([NonExpenditures ],DATESYTD('Date'[Date],"6/30"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks Amit!!  but the issue is how do we get a column that have months as cumulative months and then apply the cumulative amount.

dates.jpg

 

I tried as you suggested but its not rolling up. Am i missing something?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.