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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
GabbyGla
Frequent Visitor

Cumulative Sales - per customer

Hello dear all, 

 

I got a solution for the gerenal cumulated sales (running total) with following formula which works fine in a matrix where the date is in rows: 

 

Kumuliert = CALCULATE(sum(Table_Query_from_DataVirtualityUnicode[Umsatz]),filter(all(Table_Query_from_DataVirtualityUnicode),Table_Query_from_DataVirtualityUnicode[Auftragsdatum]<=Max (Table_Query_from_DataVirtualityUnicode[Auftragsdatum])))

 

 Here the matrix which is fine! 

GabbyGla_0-1652104216051.png

 

The problem is that I need to show the sales per customers in a row. So at the end it looks like this: 

 

Customer A - Sales April - Cumulated Sales 

But when I put the customer in the row section of the matrix visual it gives me kinda confusing figures which are not right. 

 

GabbyGla_1-1652104334116.png

 

Is there anything I need to add in my formula or do I have to create another measure for this case? 

 

Thanks a lot! 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try changing it to

Kumuliert =
CALCULATE (
    SUM ( Table_Query_from_DataVirtualityUnicode[Umsatz] ),
    FILTER (
        ALLEXCEPT ( Table_Query_from_DataVirtualityUnicode, Table_Query_from_DataVirtualityUnicode[Customer Name] ),
        Table_Query_from_DataVirtualityUnicode[Auftragsdatum]
            <= MAX ( Table_Query_from_DataVirtualityUnicode[Auftragsdatum] )
    )
)

I think that should work both with and without the customer in the matrix.

You may need to add more columns into the ALLEXCEPT if there are additional columns in the matrix e.g. customer ID.

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

Not sure why column totals wouldn't show up, I don't see anything in the code to affect that

johnt75
Super User
Super User

Try changing it to

Kumuliert =
CALCULATE (
    SUM ( Table_Query_from_DataVirtualityUnicode[Umsatz] ),
    FILTER (
        ALLEXCEPT ( Table_Query_from_DataVirtualityUnicode, Table_Query_from_DataVirtualityUnicode[Customer Name] ),
        Table_Query_from_DataVirtualityUnicode[Auftragsdatum]
            <= MAX ( Table_Query_from_DataVirtualityUnicode[Auftragsdatum] )
    )
)

I think that should work both with and without the customer in the matrix.

You may need to add more columns into the ALLEXCEPT if there are additional columns in the matrix e.g. customer ID.

Thank you so much! It really worked! Can you tell me why the matrix does not give me the total at the end of each column? 🙂 

Helpful resources

Announcements
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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.