Forum Discussion
Nested IF in Dax or M
- Anonymous3 years ago
Hi Kaalbartje2 ,
Please have a try.
Create a column.
column = IF ( 'table'[department] = "Department A" && 'table'[specialism] = "cardio", TRUE (), IF ( 'table'[department] = "Department B" && ( 'table'[specialism] = "cardio" || 'table'[specialism] = "pulmo" ), TRUE (), IF ( 'table'[department] = "Department C" && ( 'table'[specialism] = "pulmo" || 'table'[specialism] = "KNO" || 'table'[specialism] = "anest" ), TRUE (), FALSE () ) ) )If I have misunderstood your meaning, please provide more details with your desired output and pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Kaalbartje2 ,
Please have a try.
Create a column.
column =
IF (
'table'[department] = "Department A"
&& 'table'[specialism] = "cardio",
TRUE (),
IF (
'table'[department] = "Department B"
&& ( 'table'[specialism] = "cardio"
|| 'table'[specialism] = "pulmo" ),
TRUE (),
IF (
'table'[department] = "Department C"
&& ( 'table'[specialism] = "pulmo"
|| 'table'[specialism] = "KNO"
|| 'table'[specialism] = "anest" ),
TRUE (),
FALSE ()
)
)
)
If I have misunderstood your meaning, please provide more details with your desired output and pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
However when working with the dataset I noticed an other issue. Over the years the parameters can change. So the specialisme that belongs at a department changes.
In 2019 it's different than 2021 and further.
Can we make that decision also in the code?