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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Mewan117
Frequent Visitor

Rolling Total Month on Month

Hello All,

 

I currently have the following data in table form. I need to have the monthly totals as a rolling total and visualize it.  Eg: August would show 23+3569 and September will show 23+3569+23687. 

Mewan117_0-1670915048455.png

Mewan117_1-1670915176458.png

 

Current Visual 

Mewan117_2-1670915328213.png

 

Expected visual (example)

 

Mewan117_3-1670915362352.png

 

Thank you in advance

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

Hi @Mewan117 ,

 

Please try:

 

Cumulative = CALCULATE (
    DISTINCTCOUNT(Total[orderId]), FILTER (ALLSELECTED(Total),[Date]<=MAX('Total'[Date])))
Corrcet Total of Cumulative = 
var _t= SUMMARIZE('Total',[Date],"Cum",[Cumulative])
return IF(HASONEVALUE(Total[Date]),[Cumulative],  SUMX(_t,[Cum]))

Output:

Eyelyn9_0-1672821985508.png

Best Regards,
Eyelyn Qin
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

5 REPLIES 5
v-eqin-msft
Community Support
Community Support

Hi @Mewan117 ,

 

Please try:

 

Cumulative = CALCULATE (
    DISTINCTCOUNT(Total[orderId]), FILTER (ALLSELECTED(Total),[Date]<=MAX('Total'[Date])))
Corrcet Total of Cumulative = 
var _t= SUMMARIZE('Total',[Date],"Cum",[Cumulative])
return IF(HASONEVALUE(Total[Date]),[Cumulative],  SUMX(_t,[Cum]))

Output:

Eyelyn9_0-1672821985508.png

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

tevisyauw
Helper I
Helper I

@Mewan117 

try this :
Combine first month and year on new column

example new column name : MonthYear
and then 

Running Total = Calculate(SUM('Table1'[count of orderid]), filter(allselected('Table1'),'table1'[MonthYear] <= MAX('table1'[MonthYear])))

@tevisyauw Thank you for your response. That code didn't work, unfortunately. But I was able to use the following to get this output

Cumulative =
CALCULATE (
    DISTINCTCOUNT(Total[orderId]), FILTER (
        ALL ( 'Total' ),
        'Total'[Date].[Date]
            <= MAX ( 'Total'[Date].[Date] )))
 
Mewan117_0-1670920367517.png

 

But the totals are wrong. Also, my other slicers don't work. Eg below

Mewan117_1-1670920532651.png

 

It should only show the running total of the months that the slicer applies right? Eg for June it should be 76902+144373?


@Mewan117 
For Slicer usually I make new table with Calendar Date

Date = CALENDAR(MIN('Total'[Date],MAX('Total'[Date]))
and
make something like this

Cumulative =
CALCULATE (
    DISTINCTCOUNT(Total[orderId]), FILTER (
        ALL ( 'Total' ),
        'Total'[Date] > FIRST('Calendar'[Date]) && 'Total'[Date]<= LAST('Calendar'[Date] )))

I am sorry, I am outside right now so i cannot test my measure. but usually I made the measure like this

@tevisyauw It didn't work. It gave me some strange numbers. I got close with this code

Cumulative =
CALCULATE (
    DISTINCTCOUNT(Total[orderId]), FILTER (
        ALL ( 'Total' ),
        'Total'[Date].[Date]
            <= MAX ( 'Total'[Date].[Date] )),
           
            FILTER(ALL('Total'),Total[companyId]<=MAX(Total[companyId])))

It works for some companyId's but not for all

Example of one that works (totals are a little different)
Mewan117_0-1670934369176.png

Example of one that doesn't work

Mewan117_1-1670934408049.png

I haven't figured out why this is happening. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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