Forum Discussion
Complicated Conditional conditions Column
- 5 years ago
Hi Anonymous ,
Yes, possible in both Power Query and DAX, but the implementation largely depends on whether your fields are all in the same table or not.
Assuming that they are, go to Add Column tab in Power Query, select Custom Column, then enter something like the following formula in the calculation window. I'd recommend doing this in Power Query as DAX calculated columns should only really be used as an absolute last resort due to the memory use they require.
if [Date] = #date(2021, 26, 04) and [Time] >= #time(01, 30, 00) and [Time] <= #time(08, 30, 00) and [SLA Met] = 0 and [Service Desk] = "EUC" then "OK" else "Not OK"If they aren't in the same table, you will either need to merge your tables in Power Query before adding this column, or you will need to create the column in DAX, using RELATED() to reference fields that aren't in the same table (presuming that there is a suitable relationship in place between the tables).
Pete
Hi Anonymous ,
Yes, possible in both Power Query and DAX, but the implementation largely depends on whether your fields are all in the same table or not.
Assuming that they are, go to Add Column tab in Power Query, select Custom Column, then enter something like the following formula in the calculation window. I'd recommend doing this in Power Query as DAX calculated columns should only really be used as an absolute last resort due to the memory use they require.
if [Date] = #date(2021, 26, 04)
and [Time] >= #time(01, 30, 00)
and [Time] <= #time(08, 30, 00)
and [SLA Met] = 0
and [Service Desk] = "EUC"
then "OK"
else "Not OK"
If they aren't in the same table, you will either need to merge your tables in Power Query before adding this column, or you will need to create the column in DAX, using RELATED() to reference fields that aren't in the same table (presuming that there is a suitable relationship in place between the tables).
Pete