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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Sirhawk3017
Helper I
Helper I

Matrix Not Totaling - Only Show Negative Values

Hello,

 

I'm trying to create a measure that only shows negative values in a matrix. It works but it won't total in the matrix total. The variance formula pulls from two different tables. The weird thing is if I flip the sign to > it shows and totals the positive values.

 

 

 

Sales YTD Show Negative = if([AMS_ISN_$_Variance]<0,[AMS_ISN_$_Variance],blank())

 

Sirhawk3017_0-1723297953447.png

 

1 ACCEPTED SOLUTION

Thanks for the reply from mickey64 , please allow me to provide another insight:

Hi, @Sirhawk3017 

Regarding the issue you raised, my solution is as follows:

First I have created the following table and the column names and data are the data you have given:

vlinyulumsft_0-1723429882511.png

I offer you two solutions:

1.The first converts a measure into a calculated column:

vlinyulumsft_1-1723429912748.png

Then modify the position of the following image:
 

vlinyulumsft_2-1723429924720.png

2.Second, you can modify your measure to:

SUMX (
    FILTER ( 'Table', [AMS_ISN_$_Variance] < 0 ),
    'Table'[AMS_ISN_$_Variance]
)

3.Here's my final result, which I hope meets your requirements.

vlinyulumsft_3-1723429975857.png

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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

6 REPLIES 6
mickey64
Super User
Super User

For your reference.

 

Total Negative Value of leaf level = EXPANDALL(SUM([Sales YTD Show Negative]), ROWS)

 

Using visual calculations in Power BI Desktop - Power BI | Microsoft Learn

Thanks so much for the quick reply! When I type expanall in the measure, it doesn't show it as a function he can use.

 

 

Sirhawk3017_0-1723320115992.png

 

Thanks for the reply from mickey64 , please allow me to provide another insight:

Hi, @Sirhawk3017 

Regarding the issue you raised, my solution is as follows:

First I have created the following table and the column names and data are the data you have given:

vlinyulumsft_0-1723429882511.png

I offer you two solutions:

1.The first converts a measure into a calculated column:

vlinyulumsft_1-1723429912748.png

Then modify the position of the following image:
 

vlinyulumsft_2-1723429924720.png

2.Second, you can modify your measure to:

SUMX (
    FILTER ( 'Table', [AMS_ISN_$_Variance] < 0 ),
    'Table'[AMS_ISN_$_Variance]
)

3.Here's my final result, which I hope meets your requirements.

vlinyulumsft_3-1723429975857.png

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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


 

For your reference.

In the picture below I am using another PBIX file.

 

mickey64_0-1723345734913.png

 

This worked thank you sooooo much!

Hi,@Sirhawk3017 

 

We are very glad to know that the issue has been resolved. If you wish, consider accepting mickey64's solution as a solution that will also benefit other community members who have the same problem as you and find a solution faster.

 

Of course, if there is anything else we can do for you, please do not hesitate to contact us.

 

Looking forward to your reply.

 

Best Regards,

Leroy Lu

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 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.

Sept NL Carousel

Fabric Community Update - September 2024

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