Forum Discussion
NatK
Helper I
5 years agoMeasure: Combine two calculations into one
Hi, I have the following two working calculations in my measure that I would like to combine into one calculation using an OR (||) statement: balanceA calculates Amount when the date equals ...
Anonymous
5 years agoNot applicable
HI NatK,
I do not so recommend you combine them into one calculation function with multiple conditions. (By default, Dax calculate function used the 'AND' logic to link all filter conditions)
For your scenario, I'd like to suggest you nested calculate functions and move the public part outer and another part internal.
measure =
CALCULATE (
CALCULATE ( SUM ( Table[Amount] ), FILTER ( T1, 'condition' ) ) //calculate 1
+ CALCULATE ( SUM ( Table[Amount] ), FILTER ( T2, 'condition 2' ) ), //calculate 2
FILTER ( T3, 'condition 3' ) //public filter
)
Regards,
Xiaoxin Sheng