Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello,
I need to concatenate text based on several columns with if condition.
My formula is the following:
(if [column1] <> 0 then "1" else "") & (if [Column2] <> 0 then "2" else "") & (if [Column3] <> 0 then "3" else ""))
My goal is to get "123" if none of my columns have a zero value, but I'd like to get "12" or "13" or "1" if some of my columns contain zero values. Yet, the else "" creates an error, it seems that power BI can't concatenate values if one of the value is "".
Do you have any idea of how to solve this issue ?
Thanks !
Solved! Go to Solution.
@Anonymous
also works fine.
Could you please check if all the data in these three columns are number not text?
Proud to be a Super User!
@Anonymous
Did you do this in PQ?
It looks fine on my end.
= Table.AddColumn(#"Changed Type", "Custom", each (if [Column1] <> 0 then "1" else "") & (if [Column2] <> 0 then "2" else "") & (if [Column3] <> 0 then "3" else ""))
Proud to be a Super User!
Hello,
Thank your for your answer, but did you try if it works if the 0 is in Column2 ?
@Anonymous
also works fine.
Could you please check if all the data in these three columns are number not text?
Proud to be a Super User!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
84 | |
84 | |
67 | |
63 | |
62 |
User | Count |
---|---|
199 | |
120 | |
110 | |
79 | |
69 |