Forum Discussion
multiple conditions + calculation
Syndicate_Admin Not accessible.
- Samarth_184 years agoCommunity Champion
@Olboss_384 , Please try this:-
Column = if(Tabelle2[category] = "küche"&& Tabelle2[Order] > DATE ( 2021, 12, 31 )&& Tabelle2[Order] < DATE ( 2022, 12, 31 ), 0 * 200, if(Tabelle2[category] = "küche"&& Tabelle2[Shipment] > DATE ( 2021, 12, 31 )&& Tabelle2[Shipment] < DATE ( 2022, 12, 31 ), 0.25 * 200, IF( [category] = "küche" && [IBN] > DATE ( 2021, 12, 31 ) && [IBN] < DATE ( 2022, 12, 31 ), 0.5 * 200, if(Tabelle2[category] = "küche"&& Tabelle2[Ready] > DATE ( 2021, 12, 31 )&& Tabelle2[Ready] < DATE ( 2022, 12, 31 ), 0.5 * 200, if(Tabelle2[category] = "Bad"&& Tabelle2[Order] > DATE ( 2021, 12, 31 )&& Tabelle2[Order] < DATE ( 2022, 12, 31 ), 0 * 200, if(Tabelle2[category] = "Bad"&& Tabelle2[Shipment] > DATE ( 2021, 12, 31 )&& Tabelle2[Shipment] < DATE ( 2022, 12, 31 ), 0.25 * 200, if(Tabelle2[category] = "Bad"&& Tabelle2[IBN] > DATE ( 2021, 12, 31 )&& Tabelle2[IBN] < DATE ( 2022, 12, 31 ), 0.5 * 200, if(Tabelle2[category] = "Bad"&& Tabelle2[Ready] > DATE ( 2021, 12, 31 )&& Tabelle2[Ready] < DATE ( 2022, 12, 31 ), 0.5 * 200 ))))))))Departure:-
Thank you
Samarth
- Syndicate_Admin4 years agoAdministrator
Thank you for the help, it works.
Is it possible to define the date in the code as a variable so that I do not have to write this out?
--> In case I need to change the date, I would only have to do this in the variable and not in every line.
For example
- Samarth_184 years agoCommunity Champion
Syndicate_Admin Okay try this then:-
Column = var _yr_2021 = DATE ( 2021, 12, 31 ) var _yr_2022 = DATE ( 2022, 12, 31 ) return if(Tabelle2[category] = "küche"&& Tabelle2[Order] > _yr_2021&& Tabelle2[Order] < _yr_2022, 0 * 200, if(Tabelle2[category] = "küche"&& Tabelle2[Shipment] > _yr_2021&& Tabelle2[Shipment] < _yr_2022, 0.25 * 200, IF( [category] = "küche" && [IBN] > _yr_2021 && [IBN] < _yr_2022, 0.5 * 200, if(Tabelle2[category] = "küche"&& Tabelle2[Ready] > _yr_2021&& Tabelle2[Ready] < _yr_2022, 0.5 * 200, if(Tabelle2[category] = "Bad"&& Tabelle2[Order] > _yr_2021&& Tabelle2[Order] < _yr_2022, 0 * 200, if(Tabelle2[category] = "Bad"&& Tabelle2[Shipment] > _yr_2021&& Tabelle2[Shipment] < _yr_2022, 0.25 * 200, if(Tabelle2[category] = "Bad"&& Tabelle2[IBN] > _yr_2021&& Tabelle2[IBN] < _yr_2022, 0.5 * 200, if(Tabelle2[category] = "Bad"&& Tabelle2[Ready] > _yr_2021&& Tabelle2[Ready] < _yr_2022, 0.5 * 200 - Syndicate_Admin4 years agoAdministrator
Hi, I just noticed that the values are not added up.
Can you please help me again.
- Samarth_184 years agoCommunity Champion
Syndicate_Admin , It is not required. You can directly use this column on your visual and mark summerization as SUM or create a measure with below code and use it:-
measure = Sum(Tabelle2[column]) - Anonymous4 years agoNot applicable
Thank you. But I do not want to make the sum of all projects, such as summerization.
Calculation within the formula would need to be adjusted.
In the formula the result is 100, but it should be 200.