Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Each if clauses - Text comparisons

Unfortunately, I only have a rudimentary knowledge of PowerQuery and would need some assistance.

 

I would like to create a user-defined column in which text entries from another column are evaluated.

 

= Table.AddColumn(#"Umbenannte Spalten", "Vers_act", each if Text.Contains([BricsCAD Version], "Pro") then "Pro Version" else
each if Text.Contains([BricsCAD Version], "V19") then "Lite Version" else
each if Text.Contains([BricsCAD Version], "V20") then "Lite Version" else null)

 

Expected result -> column with entries: Pro Version, Pro Version, Lite Version, Lite Version....

 

Generated result:

deviation.JPG

 

Can you provide a small explanation, why the other statements aren´t recognized / a function gets returned instead of a Text /String?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

I reproduced your issue.

vstephenmsft_0-1677825533471.png

Please remove "each" and it will be correct.

2.png

vstephenmsft_1-1677825821308.png

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you very much for your help, really appreciate that 🙂

Anonymous
Not applicable

Hi @Anonymous ,

 

I reproduced your issue.

vstephenmsft_0-1677825533471.png

Please remove "each" and it will be correct.

2.png

vstephenmsft_1-1677825821308.png

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors