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
Majidbhatti
Advocate IV
Advocate IV

Cumulative Sum of Total Savings

Hi,

I have 3 columns "Current Price", "Previous Price" & "Savings". The formulas are as below.

 

Current Price = 
CALCULATE(PurchaseReceipts[Total Invoice wo Tax]/Sum(PurchaseReceipts[qty]))


Previous Price = 
CALCULATE(PurchaseReceipts[Current Price], PREVIOUSMONTH(DateTable[Date]))


Savings = 
    If(HASONEFILTER(Products[Product Name]),
        If(
            OR(isblank(PurchaseReceipts[Current Price]), 
                isblank(PurchaseReceipts[Previous Price])),
            blank(), 
            PurchaseReceipts[Previous Price] - PurchaseReceipts[Current Price]
        ),
        CALCULATE(
            PurchaseReceipts[Previous Price] - PurchaseReceipts[Current Price],
            ALLSELECTED(PurchaseReceipts) ,VALUES(Products)
        )
    )

 

The problem is evident, I need totals of the "Savings" column and BLANKS in "current price" & "previous price" as shown below

Majidbhatti_0-1638082881555.png

 

3 REPLIES 3
Majidbhatti
Advocate IV
Advocate IV

Hi @smpa01 

Were you able to see the pbix file?

 

smpa01
Super User
Super User

@Majidbhatti  is it kindly possible to post a sample pbix please?

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Hi @smpa01 


Savings needs to be totalled at all the ROW Groups. 

The file is available here

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.