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
MrBertie
Frequent Visitor

Convert Monthly Cumulative (Running) Total to Monthly Absolute Totals

I have a dataset with monthly cumulative totals for all financial columns.  Is there an easy way to convert the cumulative total in one column into an absolute monthly total instead?

 

(Yes, I have done the required couple of hours of googling, but I can't seem to find it or maybe I'm just asking the wrong question...)

6 REPLIES 6
kateshepardphd
Advocate I
Advocate I

I had to modify the formula -- maybe this will help someone:

Absolute =
VAR MonthSpent = TableName[Date].[MonthNo]
RETURN
    CALCULATE (
        MIN(TableName[CumulativeColumn])
            - CALCULATE (
                MIN(TableName[CumulativeColumn]),
                ALL ( TableName ),
                TableName[Date].[MonthNo]
                    = MonthSpent - 1
            )
    )
Baskar
Resident Rockstar
Resident Rockstar

For my uderstanding  do u want keep single record for month ? 

 

ya we can do. Share some sample data with expecting result .

i will help u to achieve your goal my dear friend .

Hello friend,
This is exactly what i want.

For example, consider the below image.

sample.PNG

 

The data i have is in the cumulative form,
But i want it to be absolute, to transform the cumulative column using Power Bi into absolute column as in the image.

 

I hope you understood, please help.

In my dataset I have the month number and Cumulative Total, I would like to calculate the absolute monthly spending as in the example below.

Image 4.png

 

@MrBertie

 

Hi, You can create a new column in your table:

 

Absolute =
VAR MonthSpent = Spending[Month]
RETURN
    CALCULATE (
        SUM ( Spending[Cumulative] )
            - CALCULATE (
                SUM ( Spending[Cumulative] ),
                ALL ( Spending ),
                Spending[Month]
                    = MonthSpent - 1
            )
    )

If your data miss the 4 month: You can add a IF

 

Absolute =
VAR MonthSpent = Spending[Month]
RETURN
    IF (
        COUNTROWS ( FILTER ( ALL ( Spending ); Spending[Month] = MonthSpent - 1 ) )
            > 0,
        CALCULATE (
            SUM ( Spending[Cumulative] )
                - CALCULATE (
                    SUM ( Spending[Cumulative] ),
                    ALL ( Spending ),
                    Spending[Month]
                        = MonthSpent - 1
                )
        ),
        CALCULATE (
            SUM ( Spending[Cumulative] )
                - CALCULATE (
                    SUM ( Spending[Cumulative] ),
                    ALL ( Spending ),
                    Spending[Month]
                        = MonthSpent - 2
                )
        )
    )

 




Lima - Peru

Hello,

There might be situations where there are many line-items in a single month or single day which are also cumulative.

Can you help me in solving this issue?

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.