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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.