Forum Discussion

Sut_Datanaut's avatar
Sut_Datanaut
Icon for Helper II rankHelper II
2 years ago
Solved

% Change over Month by customer

Hey All,    I have a table that essentially looks like below. I want to make a slicer for the app column that sees % change of all customers that roll up to that application. In order to do this, I...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Sut_Datanaut ,

    I created a sample pbix file(see the attachment), please check if that is what you want.

    % change of revenue = 
    VAR _account =
        SELECTEDVALUE ( 'Table'[Account Name] )
    VAR _part =
        CALCULATE (
            SUM ( 'Table'[Revenue] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[Account Name] = _account
                    && 'Table'[Month Date] <= SELECTEDVALUE ( 'Table'[Month Date] )
            )
        )
    VAR _all =
        CALCULATE ( SUM ( 'Table'[Revenue] ), ALLSELECTED ( 'Table' ) )
    RETURN
        DIVIDE ( _part, _all )

    Best Regards