Reputation: 1
I am trying to add a conditional column in Power BI Power Query. I have three columns with values. If all three columns return a value, then the conditional column should return true. If any column returns a null value, then I want the conditional column to return false. Newbie here and I just cannot figure it out. Any help is appreciated.
Upvotes: 0
Views: 3425
Reputation: 651
Just another way to do it (Power Query M)
'Source' is the name of the previous step and you have to adapt it when inserting it. 'Column1', 'Column2' and 'Column3' are the column names you also have to adapt.
= Table.AddColumn(Source, "AllColumnsWithData", each if List.AllTrue({[Column1]<>null,[Column2]<>null,[Column3]<>null}) then true else false)
Upvotes: 0
Reputation: 21393
In M, add a custom column
= if [columnname1]=null or [columnname2]=null or [columnname3]=null then false else true
that assumes they are real nulls, instead of blank strings, which might require =""
Upvotes: 1