Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi guys,
I have 3 columns that I would like to combine into one. I would like to do this in power query as I have alot of rows.
The columns contain values from null, 0, 1,2.... to ~25 (see example)
I would like power query to check column 1 and if there is a number, use this in the new column. If null or 0, then check column 2 and use this number. If this is also null or 0, then use result from column 3.
How can I do this in the power query?
Thank you for all answers 🙂
Solved! Go to Solution.
You can add a custom column with an expression like this to get your result.
= List.First(List.Select({[Column1], [Column2], [Column3]}, each _ <> null and _ <> 0))
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
You can add a custom column with an expression like this to get your result.
= List.First(List.Select({[Column1], [Column2], [Column3]}, each _ <> null and _ <> 0))
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
This works. Thanks!
Now that I have begun to grasp how DAX works I have realised that much of my work would be better done in the power query, so I need to learn M aswell...
I dont understand why your code does, but it will suffice for now, and then down the road I will understand why. 🙂
Thank you again.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |