Forum Discussion
T_JF2022
3 years agoFrequent Visitor
DAX Condition multiply
Hello, I have the problem to build a measure in which I multiply by a factor when a condition is met. For Example - Fact Table Name Amount Date Adidas 100 30.10.2022 Nike 100 30.1...
- 3 years ago
Hi,
I am not sure how your datamodel looks like, but please check the below pictures and the attached pbix file whether it suits your requirement.
Total bonus: = SUMX ( DISTINCT ( 'Name'[Name] ), CALCULATE ( SUMX ( 'Fact', 'Fact'[Amount] * MAXX ( FILTER ( Bonus, Bonus[Name] = RELATED ( 'Name'[Name] ) && Bonus[Year] = YEAR ( EARLIER ( 'Fact'[Date] ) ) ), Bonus[Bonus] ) ) ) )
Jihwan_Kim
3 years agoSuper User
Hi,
I am not sure how your datamodel looks like, but please check the below pictures and the attached pbix file whether it suits your requirement.
Total bonus: =
SUMX (
DISTINCT ( 'Name'[Name] ),
CALCULATE (
SUMX (
'Fact',
'Fact'[Amount]
* MAXX (
FILTER (
Bonus,
Bonus[Name] = RELATED ( 'Name'[Name] )
&& Bonus[Year] = YEAR ( EARLIER ( 'Fact'[Date] ) )
),
Bonus[Bonus]
)
)
)
)