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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
darrigg
Frequent Visitor

Get Difference and % Difference In Matrix Table when values are Measures

Hi - I am trying to make 2 extra columns in the matrix below that calculate the difference and then the % difference of each one of these measures.

 

I created a matrix and swtiched values to rows. Is there a way to do this?

 

All of the measures look like this: 

Direct Income = CALCULATE(Sum('Summary Compare Income Statement'[Value]), Filter('Summary Compare Income Statement', 'Summary Compare Income Statement'[ACCT.Profitability] = "Direct Income"))
 
And then I pulled in the Column that defines the ACTUALS / BUDGET for the measure.

 

darrigg_0-1656010336536.png

 

Thank you!!!!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @darrigg ,

 

As I mentioned above, I think [Actual vs Budget] in matrix column should be a column with only two values "Actual" and "Budget". So you add multiple measures or columns into value fields and matrix will expand into only two columns "Actual" and "Budget". 

You can add a column with more values like "Actual", "Budget","Diff" and "Diff%" into Matrix column field.

Then create measures by switch function. For example, [Direct Income] measure should look like as below.

Direct Income =
VAR _Acutal = [Actual for Direct Income]
VAR _Budget = [Budget for Direct Income]
VAR _DIFF = [Diff for Direct Income]
VAR _DIFF_PERCENT = [Diff % for Direct Income]
RETURN
    SWITCH (
        SELECTEDVALUE ( [ColumnField] ),
        "Actual", _Acutal,
        "Budget", _Budget,
        "DIFF", _DIFF,
        "DIFF%", _DIFF_PERCENT
    )

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @darrigg ,

 

I suggest you to add 'Summary Compare Income Statement'[ACCT.Profitability] column into matrix rows field. 

And then calculate [Actual] and  [Budget] separately.

Acutal =
CALCULATE (
    SUM ( 'Summary Compare Income Statement'[Value] ),
    FILTER (
        'Summary Compare Income Statement',
        'Summary Compare Income Statement'[Actual vs Budget] = "Actual"
    )
)
Acutal =
CALCULATE (
    SUM ( 'Summary Compare Income Statement'[Value] ),
    FILTER (
        'Summary Compare Income Statement',
        'Summary Compare Income Statement'[Actual vs Budget] = "Budget"
    )
)
Diff = [Actual] - [Budget]
Diff % = DIVIDE([Diff],[Budget])

Add these measures into matrix value field.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Thanks, Rico.

 

The reason why I have it set up like this is because Net Profit, Taxes, and net interest income are calculated off of the measures. So If i pull in the profitability into the, it would work, but i would need to sort and organize and have calculated measures inbetween the columns.

 

darrigg_1-1656334842574.png

 

Although not the prettiest, I created additional measures to calculate the different in a long measure by using CALCULATE and filtering for actuals vs budget and then finding the difference. I renamed each row header to be " " so there is nothing there (unless there is a better way to do this?).

darrigg_2-1656334866388.png

 

I will be working on creating a similar format for the % difference.

 

Any other ideas to make it more in one table? Or is my janky workaround fine you think?

Anonymous
Not applicable

Hi @darrigg ,

 

As I mentioned above, I think [Actual vs Budget] in matrix column should be a column with only two values "Actual" and "Budget". So you add multiple measures or columns into value fields and matrix will expand into only two columns "Actual" and "Budget". 

You can add a column with more values like "Actual", "Budget","Diff" and "Diff%" into Matrix column field.

Then create measures by switch function. For example, [Direct Income] measure should look like as below.

Direct Income =
VAR _Acutal = [Actual for Direct Income]
VAR _Budget = [Budget for Direct Income]
VAR _DIFF = [Diff for Direct Income]
VAR _DIFF_PERCENT = [Diff % for Direct Income]
RETURN
    SWITCH (
        SELECTEDVALUE ( [ColumnField] ),
        "Actual", _Acutal,
        "Budget", _Budget,
        "DIFF", _DIFF,
        "DIFF%", _DIFF_PERCENT
    )

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.