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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
bzjens
Frequent Visitor

P&L statement calculated row in matrix visual

Hi!

 

I am trying to add a calculated row to a profit & loss statement matrix visual

(very simplified in this post)

 

This is what I have:

image.png

 

This is what I want:

image.png

Here Tax is calculated as 25% of "Total before tax"

 

And these are my tables and relations:

image.png

 

Does this has an easy solution? (one that I don't see....)

 

Thanks!

Børre

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @bzjens 

For your requirement, you could try this way as below:

Step1:

Add a row for Tax in Accounts table as below:

3.JPG

Step2:

Add a measure by this logic

Measure = 
VAR _table =
    SUMMARIZE (
        Accounts,
        Accounts[category],
        Accounts[subcategory],
        "a", IF (
            SELECTEDVALUE ( Accounts[category] ) = "Total before Tax",
            CALCULATE ( SUM ( Transactions[Value] ), ALLSELECTED ( Accounts ) ) * 0.25,
            CALCULATE ( SUM ( Transactions[Value] ) )
        )
    )
RETURN
    IF (
        HASONEVALUE ( Accounts[category] ),
        IF (
            SELECTEDVALUE ( Accounts[category] ) = "Total before Tax",
            CALCULATE ( SUM ( Transactions[Value] ), ALLSELECTED ( Accounts ) ) * 0.25,
            CALCULATE ( SUM ( Transactions[Value] ) )
        ),
        SUMX ( _table, [a] )
    )

Then use this measure in matrix visual.

Result:

4.JPG

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
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

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @bzjens 

For your requirement, you could try this way as below:

Step1:

Add a row for Tax in Accounts table as below:

3.JPG

Step2:

Add a measure by this logic

Measure = 
VAR _table =
    SUMMARIZE (
        Accounts,
        Accounts[category],
        Accounts[subcategory],
        "a", IF (
            SELECTEDVALUE ( Accounts[category] ) = "Total before Tax",
            CALCULATE ( SUM ( Transactions[Value] ), ALLSELECTED ( Accounts ) ) * 0.25,
            CALCULATE ( SUM ( Transactions[Value] ) )
        )
    )
RETURN
    IF (
        HASONEVALUE ( Accounts[category] ),
        IF (
            SELECTEDVALUE ( Accounts[category] ) = "Total before Tax",
            CALCULATE ( SUM ( Transactions[Value] ), ALLSELECTED ( Accounts ) ) * 0.25,
            CALCULATE ( SUM ( Transactions[Value] ) )
        ),
        SUMX ( _table, [a] )
    )

Then use this measure in matrix visual.

Result:

4.JPG

and here is sample pbix file, please try it.

 

Regards,

Lin

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

Nice! Thanks! This pointed me in the right direction.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.