The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi there,
I am trying to do an IF statement where it checks if there is text within a cell, if thre is text then I need the cells concatenated, if there is no text then I need them to SUM. The SUM part works fine on its own but once I wrap the IF statement in there, then I get the above expression error, I'd be grateful if anyone would have a solution please?
Adding custom column code: if not Text.Contains([Primary Motor], "x") or not Text.Contains([Secondary Motor], "x") then [Primary Motor] + [Secondary Motor] else Text.From([Primary Motor]) & ", " & Text.From([Secondary Motor])
Thank you so much
Solved! Go to Solution.
You could try something like:
if [Primary Motor] is text and [Secondary Motor] is text then Text.Combine( {[Primary Motor], [Secondary Motor]}) else [Primary Motor] + [Secondary Motor]
--------------------------------------------------
@ me in replies or I'll lose your thread
Master Power Query M? -> https://powerquery.how
Read in-depth articles? -> BI Gorilla
Youtube Channel: BI Gorilla
If this post helps, then please consider accepting it as the solution to help other members find it more quickly.
Hi Vijay, I received the same error when I attempted to use the Number.From but thank you so much for responding to me.
Rick, your solution worked perfectly, thank you both so much!
You could try something like:
if [Primary Motor] is text and [Secondary Motor] is text then Text.Combine( {[Primary Motor], [Secondary Motor]}) else [Primary Motor] + [Secondary Motor]
--------------------------------------------------
@ me in replies or I'll lose your thread
Master Power Query M? -> https://powerquery.how
Read in-depth articles? -> BI Gorilla
Youtube Channel: BI Gorilla
If this post helps, then please consider accepting it as the solution to help other members find it more quickly.
Replace this part
[Primary Motor] + [Secondary Motor]
With
Number.From([Primary Motor])+Number.From([Secondary Motor])