Forum Discussion

Take2's avatar
Take2
Regular Visitor
3 years ago
Solved

SUM Only Specified Values For All Higher Matrix Levels

Hello -    Here is the link to the PBIX:  https://drive.google.com/file/d/1vdZmj0n0-JpCXnQ6kqTgxxjGW_8x-rx8/view?usp=drive_link   The following Rows exist in the below Matrix: - SalesRep Name ...
  • tamerj1's avatar
    3 years ago

    Take2 
    Hi Nathan. Apologies for the late response. I really didn't have the time to look into it. Please look at the proposed solution below

    Type 2 V2 New = 
    VAR Type1Exists = NOT ISBLANK ( [Type 1] )
    VAR Type2AllQuarters =
        SUMX ( 
            SUMMARIZE ( 
                Data,
                SalesRep[SalesRep Name],
                Customer[Customer Name],
                'Product'[Product Name]
            ),
            CALCULATE (
                [Type 2],
                REMOVEFILTERS ( 'Calendar'[Year Quarter Number] )
            )
        )
    VAR Result = 
        IF ( Type1Exists, Type2AllQuarters )
    RETURN 
        Result