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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
mikeoshields
Helper I
Helper I

Difference between two rows in a matrix (row subdifferences)

I've searched through the community for an answer to this but haven't found one yet. Where there would normally be Row Subtotals, I need to have row subdifferences.  The first image below is the matrix in PowerBI, the second is an excel example of what I need.  Any help would be appreciated.

 

mikeoshields_0-1664373618514.png

 

mikeoshields_1-1664374210290.png

 

 

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

Hi @mikeoshields ,

 

Measure can only be placed in the value of the matrix view, and the view you expect cannot be achieved with a matrix.

 

This can currently be achieved:

Sample data:

vyinliwmsft_0-1664442613396.png

 

Measure:

Difference =
CALCULATE (
    MAX ( 'Table'[Value] ),
    FILTER (
        ALL ( 'Table' ),
        [UCT_CD] = SELECTEDVALUE ( 'Table'[UCT_CD] )
            && [Date] = SELECTEDVALUE ( 'Table'[Date] )
    )
)
    - CALCULATE (
        MIN ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            [UCT_CD] = SELECTEDVALUE ( 'Table'[UCT_CD] )
                && [Date] = SELECTEDVALUE ( 'Table'[Date] )
        )
    )

 

The result is:

vyinliwmsft_1-1664442613400.png

 

              

 

Hope this helps you.

 

Best Regards,

Community Support Team _Yinliw

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

1 REPLY 1
v-yinliw-msft
Community Support
Community Support

Hi @mikeoshields ,

 

Measure can only be placed in the value of the matrix view, and the view you expect cannot be achieved with a matrix.

 

This can currently be achieved:

Sample data:

vyinliwmsft_0-1664442613396.png

 

Measure:

Difference =
CALCULATE (
    MAX ( 'Table'[Value] ),
    FILTER (
        ALL ( 'Table' ),
        [UCT_CD] = SELECTEDVALUE ( 'Table'[UCT_CD] )
            && [Date] = SELECTEDVALUE ( 'Table'[Date] )
    )
)
    - CALCULATE (
        MIN ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            [UCT_CD] = SELECTEDVALUE ( 'Table'[UCT_CD] )
                && [Date] = SELECTEDVALUE ( 'Table'[Date] )
        )
    )

 

The result is:

vyinliwmsft_1-1664442613400.png

 

              

 

Hope this helps you.

 

Best Regards,

Community Support Team _Yinliw

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

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.