cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JakobH
Frequent Visitor

Binning dates in cumulative total measure

Hello

I have a "Cumulative Total" measure. I want to create a table/graph where cumulative amounts are displayed against months

Simply binning the dates does not work. Then only the sum for the specific months are displayed instead of the cumulative amount.

Any tips on how i can show the cumulative total against months?

 

Cumulative Total = 
CALCULATE(SUM(Fact[Amount]),
    FILTER(ALL(Fact[Date]),
        Fact[Date] <= MAX(Fact[Date])
        )
    )

 

1 ACCEPTED SOLUTION
Alf94
Solution Supplier
Solution Supplier

Hi @JakobH,

 

If you are looking for a cumulative total that starts again every year you can try the following:

 

Cumulative total =
    CALCULATE(
        SUM( Fact[Amount] ),
        DATESYTD( Calendar[Date] )
    )

 

where Calendar is a table containing all your dates.

 

If I answered your question, please mark my post as a solution.

Best,

View solution in original post

2 REPLIES 2
Alf94
Solution Supplier
Solution Supplier

Hi @JakobH,

 

If you are looking for a cumulative total that starts again every year you can try the following:

 

Cumulative total =
    CALCULATE(
        SUM( Fact[Amount] ),
        DATESYTD( Calendar[Date] )
    )

 

where Calendar is a table containing all your dates.

 

If I answered your question, please mark my post as a solution.

Best,

JakobH
Frequent Visitor

Thanks for the reply, but what i wanted to achieve is to get a running total where all entries within a month are summed up.

I found a solution that works, where i create a new column which equals the the binned date group and use this column in my measure:

Cumulative Total = 
CALCULATE(SUM(Fact[Amount]),
    FILTER(ALL(Fact[BinnedDate]),
        Fact[BinnedDate] <= MAX(Fact[BinnedDate])
        )
    )

 

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors