cancel
Showing results for
Did you mean:
Frequent Visitor

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

 Person Legacy Mid-Tier Current DAX Total A 6 0 4 -2 B 4 1 3 0 C 6 3 5 2 TOTAL 12  (Sum Total) 4  (Sum Total) 12  (Sum Total) 4  (Calc Total (C+M)-L

1 ACCEPTED SOLUTION
Community Support

Hi @ScottBrown ,

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

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.

2 REPLIES 2
Community Support

Hi @ScottBrown ,

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

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.

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]

Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Announcements

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!