cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

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
Super User

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.

Best,

2 REPLIES 2
Super User

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.

Best,

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])
)
)``````

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors