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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Alice_T
Frequent Visitor

How to get the right total in a matrix of the minimum between two measures

Hi, I need help solving this problem:

 

There is a matrix containing two measures representing the sum of a column:

a = CALCULATE(SUMX(flow, value), flow[name]="A")
b = CALCULATE(SUMX(flow, value), flow[name]="B")

Subsequently, a second measure is created which represents the minimum absolute value between these two measures:

c = MIN(ABS([a]), ABS([b]))

While this measure correctly displays the numbers per row, it fails to provide the accurate total. Instead of summing the values above the total, it computes the minimum value from the sum of the other two measures.

 

Here is the matrix:

 

LetterShortYearabc
PA2024403-367366.92
PA202590-9090.36
PA2026   
PB2024 -110 
PB2025 -18 
PB2026   
PC2024128-1413.94
PC2025   
PC2026   
PD20243-2762.78
PD2025 -61 
PD2026 -18 
PE20248  
PE2025   
PE2026   
PF2024127  
PF2025   
PF2026   
PG20241-30.64
PG2025   
PG2026   
PH2024 -57 
PH2025 -21 
PH2026 -15 
PI2024 -3 
PI2025   
PI2026   
PJ20245  
PJ2025   
PJ2026   
PK2024 0 
PK2025   
PK2026   
PL20247-10.51
PL2025   
PL2026   
PM202440  
 Total from matrix 812-1054812
 Total that i want 812-1054475.15
      
1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Alice_T,

 

Try this measure:

 

c = 
SUMX (
    SUMMARIZE ( flow, flow[Letter], flow[Short], flow[Year] ),
    MIN ( ABS ( [a] ), ABS ( [b] ) )
)

 

DataInsights_0-1708625532801.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Alice_T ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
DataInsights
Super User
Super User

@Alice_T,

 

Try this measure:

 

c = 
SUMX (
    SUMMARIZE ( flow, flow[Letter], flow[Short], flow[Year] ),
    MIN ( ABS ( [a] ), ABS ( [b] ) )
)

 

DataInsights_0-1708625532801.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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