Forum Discussion
multiple conditions + calculation
Hi Community,
following problem.
My calculation with multiple conditions including addition does not work
Here is my formula that doesn't work:
If(and( Category ="Küche" && Order >(Date(2021, 12, 31) && Order < (Date(2022, 12, 31), Calculate(0*200) +
If(and( Category ="Küche" && Shiptment>(Date(2021, 12, 31) && Order < (Date(2022, 12, 31), Calculate(0,25*200) +
If(and( Category ="Küche" && IBN>(Date(2021, 12, 31) && Order < (Date(2022, 12, 31), Calculate(0,5*200) +
If(and( Category ="Küche" && Ready>(Date(2021, 12, 31) && Order < (Date(2022, 12, 31), Calculate(0,25*200) )))
Does anyone have an idea how I can do this calculation in Power BI?
19 Replies
- Samarth_18Community Champion
Hi Anonymous ,
Create a column with below code
Column = SWITCH ( TRUE (), Category = "Küche" && Order > DATE ( 2021, 12, 31 ) && Order < DATE ( 2022, 12, 31 ), 0 * 200, Category = "Küche" && Shiptment > DATE ( 2021, 12, 31 ) && Order < DATE ( 2022, 12, 31 ), 0.25 * 200, Category = "Küche" && Shiptment > DATE ( 2021, 12, 31 ) && Order < DATE ( 2022, 12, 31 ), 0.25 * 200, Category = "Küche" && IBN > DATE ( 2021, 12, 31 ) && Order < DATE ( 2022, 12, 31 ), 0.5 * 200, Category = "Küche" && Ready > DATE ( 2021, 12, 31 ) && Order < DATE ( 2022, 12, 31 ), 0.25 * 200 )and then create a measure like below or directly used new column as summerized as sum
Measure = Sum(table[column])Thanks,
Samarth
- Syndicate_AdminAdministrator
Thanks for your help - Unfortunately it doesn't work.
- Samarth_18Community Champion
Syndicate_Admin , Remove last comma(",") from the last line i.e. line 28.
- Samarth_18Community Champion
Anonymous I think you have uploaded it on your office drive and we dont have access to it. Better try to give access to all or use wetranfer.com or similar to it.