Forum Discussion
Combine CALCULATION DAX in Measure
- 1 year ago
Hello CornelisV ,
try using the below dax.
Sales = CALCULATE ( [Sales Amount] * IF ( MAX ( 'Date'[Fiscal Month Number] ) < 6, 0.2, -- multiplier if month < 6 0.1 -- multiplier if month >= 6 ) ) - 1 year ago
Dear Idrissshatila ,
Thank you for your solution, this is very clear. It works.
Good to see that IF statement can be implemented in the DAX, this is something that I cannot find it so easily back in DAX training book.
Best regards,
Cornelis.
Hi CornelisV ,
You can achieve this through the use of the IF() or SWITCH() functions. Here is an example using SWITCH():
Sales =
CALCULATE(
[Sales Amount] *
SWITCH(
TRUE(),
MAX('Date'[Fiscal Month Number]) < 6, 0.2,
MAX('Date'[Fiscal Month Number]) > 6, 0.1,
1
)
)
If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.
Thanks,
Samson
Connect with me on LinkedIn
Check out my Blog
Going to the European Microsoft Fabric Community Conference? Check out my Session
Hello SamsonTruong,
A Kind note on this measure so that CornelisV knows, that if its equal 6 then it will be sales amount * 1, unless you want it to fit to one of the first two conditions then you make it >= or <=.