Forum Discussion
How to add percent difference 'column' to matrix
- Anonymous2 years ago
lbendlin Thanks for your contribution on this thread.
Hi BrazenTelephone ,
You can follow the steps below to get it:
1. Select the matrix visual and navigate to format pane. Toggle on the option "Column subtotals" and change Subtotal label as "Percent Change" just as shown in below screenshot
2. Create another new 5 measures to replace the orignal measures
New_AvgStep1_duration = VAR _before = SUMX ( FILTER ( 'Table', [Period] = "BeforeChange" ), [AvgStep1_duration] ) VAR _after = SUMX ( FILTER ( 'Table', [Period] = "WithChange" ), [AvgStep1_duration] ) VAR _percent = DIVIDE ( _after - _before, _before ) RETURN IF ( ISINSCOPE ( 'Table'[Period] ), [AvgStep1_duration], _percent )New_AvgStep2_duration = VAR _before = SUMX ( FILTER ( 'Table', [Period] = "BeforeChange" ), [AvgStep2_duration] ) VAR _after = SUMX ( FILTER ( 'Table', [Period] = "WithChange" ), [AvgStep2_duration] ) VAR _percent = DIVIDE ( _after - _before, _before ) RETURN IF ( ISINSCOPE ( 'Table'[Period] ), [AvgStep2_duration], _percent )New_AvgStep3_duration = VAR _before = SUMX ( FILTER ( 'Table', [Period] = "BeforeChange" ), [AvgStep3_duration] ) VAR _after = SUMX ( FILTER ( 'Table', [Period] = "WithChange" ), [AvgStep3_duration] ) VAR _percent = DIVIDE ( _after - _before, _before ) RETURN IF ( ISINSCOPE ( 'Table'[Period] ), [AvgStep3_duration], _percent )New_AvgStep4_duration = VAR _before = SUMX ( FILTER ( 'Table', [Period] = "BeforeChange" ), [AvgStep4_duration] ) VAR _after = SUMX ( FILTER ( 'Table', [Period] = "WithChange" ), [AvgStep4_duration] ) VAR _percent = DIVIDE ( _after - _before, _before ) RETURN IF ( ISINSCOPE ( 'Table'[Period] ), [AvgStep4_duration], _percent )New_AvgTotalProcess_duration = VAR _before = SUMX ( FILTER ( 'Table', [Period] = "BeforeChange" ), [AvgTotalProcess_duration] ) VAR _after = SUMX ( FILTER ( 'Table', [Period] = "WithChange" ), [AvgTotalProcess_duration] ) VAR _percent = DIVIDE ( _after - _before, _before ) RETURN IF ( ISINSCOPE ( 'Table'[Period] ), [AvgTotalProcess_duration], _percent )3. Replace the original measures with the above new measures
If the above one can't help you figure out, please provide some info just as suggested by lbendlin .
Best Regards
lbendlin Thanks for your contribution on this thread.
Hi BrazenTelephone ,
You can follow the steps below to get it:
1. Select the matrix visual and navigate to format pane. Toggle on the option "Column subtotals" and change Subtotal label as "Percent Change" just as shown in below screenshot
2. Create another new 5 measures to replace the orignal measures
New_AvgStep1_duration =
VAR _before =
SUMX ( FILTER ( 'Table', [Period] = "BeforeChange" ), [AvgStep1_duration] )
VAR _after =
SUMX ( FILTER ( 'Table', [Period] = "WithChange" ), [AvgStep1_duration] )
VAR _percent =
DIVIDE ( _after - _before, _before )
RETURN
IF ( ISINSCOPE ( 'Table'[Period] ), [AvgStep1_duration], _percent )New_AvgStep2_duration =
VAR _before =
SUMX ( FILTER ( 'Table', [Period] = "BeforeChange" ), [AvgStep2_duration] )
VAR _after =
SUMX ( FILTER ( 'Table', [Period] = "WithChange" ), [AvgStep2_duration] )
VAR _percent =
DIVIDE ( _after - _before, _before )
RETURN
IF ( ISINSCOPE ( 'Table'[Period] ), [AvgStep2_duration], _percent )New_AvgStep3_duration =
VAR _before =
SUMX ( FILTER ( 'Table', [Period] = "BeforeChange" ), [AvgStep3_duration] )
VAR _after =
SUMX ( FILTER ( 'Table', [Period] = "WithChange" ), [AvgStep3_duration] )
VAR _percent =
DIVIDE ( _after - _before, _before )
RETURN
IF ( ISINSCOPE ( 'Table'[Period] ), [AvgStep3_duration], _percent )New_AvgStep4_duration =
VAR _before =
SUMX ( FILTER ( 'Table', [Period] = "BeforeChange" ), [AvgStep4_duration] )
VAR _after =
SUMX ( FILTER ( 'Table', [Period] = "WithChange" ), [AvgStep4_duration] )
VAR _percent =
DIVIDE ( _after - _before, _before )
RETURN
IF ( ISINSCOPE ( 'Table'[Period] ), [AvgStep4_duration], _percent )New_AvgTotalProcess_duration =
VAR _before =
SUMX ( FILTER ( 'Table', [Period] = "BeforeChange" ), [AvgTotalProcess_duration] )
VAR _after =
SUMX ( FILTER ( 'Table', [Period] = "WithChange" ), [AvgTotalProcess_duration] )
VAR _percent =
DIVIDE ( _after - _before, _before )
RETURN
IF ( ISINSCOPE ( 'Table'[Period] ), [AvgTotalProcess_duration], _percent )
3. Replace the original measures with the above new measures
If the above one can't help you figure out, please provide some info just as suggested by lbendlin .
Best Regards