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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
BrazenTelephone
Regular Visitor

How to add percent difference 'column' to matrix

I need to add a column that displays the change percentage between the "BeforeChange" and "AfterChange" columns in a matrix. Is there a way to do this within the matrix visual or does anyone have alternate ways to achieve this end result?

Screenshot 2024-05-10 145933.png
Thank you in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@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

vyiruanmsft_0-1715588720762.png

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

vyiruanmsft_1-1715589032558.png

If the above one can't help you figure out, please provide some info just as suggested by @lbendlin .

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@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

vyiruanmsft_0-1715588720762.png

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

vyiruanmsft_1-1715589032558.png

If the above one can't help you figure out, please provide some info just as suggested by @lbendlin .

Best Regards

lbendlin
Super User
Super User

You can repurpose the Column Total column for that measure.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.