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

Not getting Cumulative sum using measure

Hello;

 

I have wrote a measure to calculate the cumulative sum of Revenue, till the month before from the current month.

I am able to get the revenue for all the previous months but I am not getting it as a cumulative value.

 

I have used following measure

 

RevenueActual = CALCULATE(sum(Revenue[RevenueInGBP]),filter(Revenue, Revenue[Sale/Purchase]="Sales" && Revenue[Month]< EOMONTH( today(),-1))) 

 

Revenue.JPGPlease help me how should I proceed to get the cumulative value.

Thanks

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

Hi avinrosh,

 

Are you trying to achieve the accumulate total of each row which can meet your conditions? If so, modify you measure like this pattern and check if it can work:

 

RevenueActual =
VAR last_month =
    EOMONTH ( MAX ( Revenue[Month] ), -1 )
RETURN
    CALCULATE (
        SUM ( Revenue[RevenueInGBP] ),
        FILTER (
            Revenue,
            Revenue[Sale/Purchase] = "Sales"
                && Revenue[Month] < last_month
        )
    )

Hope it's helpful.

 

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi avinrosh,

 

Are you trying to achieve the accumulate total of each row which can meet your conditions? If so, modify you measure like this pattern and check if it can work:

 

RevenueActual =
VAR last_month =
    EOMONTH ( MAX ( Revenue[Month] ), -1 )
RETURN
    CALCULATE (
        SUM ( Revenue[RevenueInGBP] ),
        FILTER (
            Revenue,
            Revenue[Sale/Purchase] = "Sales"
                && Revenue[Month] < last_month
        )
    )

Hope it's helpful.

 

Jimmy Tao

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.