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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ScottBrown
Helper II
Helper II

Unique - Complex DAX Challenge for Matrix Visual Specific for Columns & Total

This one has got me perplexed.

How do you create the DAX Measure Value for a matrix that does the following for the Totals?

  • Does the normal Summing for the columns
  • Does a special calculation for the Total column

Example Table Would Be

  • DAX Total column formula is (Current + Mid-Tier) - Legacy

 

PersonLegacyMid-TierCurrentDAX Total
A604-2
B4130
C6352
TOTAL12  (Sum Total)4  (Sum Total)12  (Sum Total)4  (Calc Total (C+M)-L

 

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

Hi @ScottBrown ,

 

Please try the following formula:

 

Measure = 
var _sum = SUM ( 'Table'[Value] )
return 
    IF (
        ISFILTERED ( 'Table'[Category] ),
        _sum,
        _sum - 2 * CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Category] = "Legacy" )
    )

vkkfmsft_0-1641870262303.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @ScottBrown ,

 

Please try the following formula:

 

Measure = 
var _sum = SUM ( 'Table'[Value] )
return 
    IF (
        ISFILTERED ( 'Table'[Category] ),
        _sum,
        _sum - 2 * CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Category] = "Legacy" )
    )

vkkfmsft_0-1641870262303.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@ScottBrown , if these are value of column say Tier and you column of value is value

 

new measure =

if((isinscope([Tier])), sum(Table[Value]) ,
Switch(true(),
max(Table[Tier]) = "Legacy" , -1 * sum(Table[Value]) ,
sum(Table[Value]) ) )

 

If they are measure 

 

then new measure

([Current] + [Mid-Tier]) - [Legacy]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.