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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Matrix Total Subtracted Value in Power BI Desktop

Dear Community Folks,

The matrix visualization in my report is summing up the measures by default on its Total. But, I wanted to have a difference (subtract) value on the Total. Please, ref the below screenshots and I have also attached .xlsx and .pbix files with this post for your kind ref.

 

Sample Excel File Link

 

Sample pbix File Link

 

excelformat.PNGexcelformat2.PNGPower BI Matrix.PNG

 

 

 

We are creating a group in Matrix out of a single field as shown in the above screenshot.

 

We need to tally the Amount of Total assets and Amount of Liabilities & Equity to Zero.

Total = Sum of Total Assets - Sum of Total Liabilities & Equity

Total = 120 - 120 = 0

But, what we are getting in Power BI matrix is the summed value. Total = 240 as depicted in the above screenshot,

 

 Is there any way to get the subtracted value,

 

Total = 120 - 120 Total = 0.

Your timely help is much appreciated.

 

Many thanks,

Praveen.

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous

 

You may try to create a measure to change the total value. Such as:

Measure  =
IF (
    ISFILTERED ( 'Single Column Data'[Major group] ),
    SUMX ( 'Single Column Data', 'Single Column Data'[Amount] ),
    SUMX (
        FILTER ( 'Single Column Data', 'Single Column Data'[Major group] = "Assets" ),
        'Single Column Data'[Amount]
    )
        - SUMX (
            FILTER (
                'Single Column Data',
                'Single Column Data'[Major group] = "Liabilities & Equity"
            ),
            'Single Column Data'[Amount]
        )
)

Regards,

Cherie

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

4 REPLIES 4
sjoshi
Helper II
Helper II

Hi Cherie 

 

How do we apply time dimesion to the below your query. As we have to calculate Prior Month,Prior Qtr, Prior Year etc.

 

Measure  =
IF (
    ISFILTERED ( 'Single Column Data'[Major group] ),
    SUMX ( 'Single Column Data', 'Single Column Data'[Amount] ),
    SUMX (
        FILTER ( 'Single Column Data', 'Single Column Data'[Major group] = "Assets" ),
        'Single Column Data'[Amount]
    )
        - SUMX (
            FILTER (
                'Single Column Data',
                'Single Column Data'[Major group] = "Liabilities & Equity"
            ),
            'Single Column Data'[Amount]
        )
)

 

Thanks

Smita

ImkeF
Community Champion
Community Champion

You wouldn't do that in that measure. Instead you can reference it with time intelligence functions (if you have a separate Calendar-Table for this). See this article for more details for example: https://exceleratorbi.com.au/dax-time-intelligence-beginners/

 

PriorMonth = CALCULATE( [Measure], DATESADD(‘Calendar'[Date], -1, MONTH))
PriorYear = CALCULATE( [Measure], DATESADD(‘Calendar'[Date], -1, Year))
...

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous

 

You may try to create a measure to change the total value. Such as:

Measure  =
IF (
    ISFILTERED ( 'Single Column Data'[Major group] ),
    SUMX ( 'Single Column Data', 'Single Column Data'[Amount] ),
    SUMX (
        FILTER ( 'Single Column Data', 'Single Column Data'[Major group] = "Assets" ),
        'Single Column Data'[Amount]
    )
        - SUMX (
            FILTER (
                'Single Column Data',
                'Single Column Data'[Major group] = "Liabilities & Equity"
            ),
            'Single Column Data'[Amount]
        )
)

Regards,

Cherie

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

Hello Cherrie,

     That's marvelous!!! Thank you so much for your help. This really works for me.

 

Many thanks,

Praveen. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!