Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello guys, hope you're good!
I have the following formula in excel, and im trying get the same results in power query:
I tried to use the conditional column in Power Query, but it returned "OK" for all the conditions. This happened because if any of the tests returns "OK," it results in "OK" for all the tests. Is there any way to do this using the M language or something similar?
Thanks in advance and sorry for my bad english hehe
Solved! Go to Solution.
Hello - you could do it like this:
= Table.AddColumn(#"Changed Type", "Custom", each if List.AllTrue ( { [Column2]="OK",[Column3]="OK",[Column4]="OK",[Column5]="OK",[Column6]="OK" } ) then "OK" else "NOTOK", type text)
If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.
Proud to be a Microsoft Fabric Super User
Use this in a custom column
if List.Contains(List.Range(Record.ToList(_), 1, 5), "NOTOK") then "NOTOK" else "OK"
thank you!! it works
Use this in a custom column
if List.Contains(List.Range(Record.ToList(_), 1, 5), "NOTOK") then "NOTOK" else "OK"
Hello - you could do it like this:
= Table.AddColumn(#"Changed Type", "Custom", each if List.AllTrue ( { [Column2]="OK",[Column3]="OK",[Column4]="OK",[Column5]="OK",[Column6]="OK" } ) then "OK" else "NOTOK", type text)
If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.
Proud to be a Microsoft Fabric Super User
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |