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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Whitesheep
Regular Visitor

POWER QUERY Column of errors

Hi, i'm quite new in the employment of POWER QUERY, could you please help me with this idea I have?

 

I have a table of data, each row has the first column as element name, the following columns descibe all the info of each element, but sometimes in some of these "info-columns" I could have an "error" value, so that every row has in the following "info-columns" zero or only one "error" value among them.


Which is the easiest way to add an "Error column" wich contains "null" value if I have no error in the "info-columns" of that row, otherwise the name of the column containing the value "error"?

 

Thank you for your kind help and expertise!

 

2 REPLIES 2
Whitesheep
Regular Visitor

@Manoj_Nair Hi! Thank you for your advice, I have thought the same and I started preparing the column your way. Since the info-columns are like a dozen I also tried using the Table.SelectRowsWithErrors function but I didn't figure out how it works 😅

Kind regards!

Manoj_Nair
Solution Supplier
Solution Supplier

@Whitesheep- Hi, I'm assumption that you have three info-columns: Info1, Info2, Info3.

 

  1. Open your table in Power Query Editor.
  2. Go to the 'Add Column' tab, and select 'Custom Column'.
  3. In the 'New column name' field, enter "Error Column".
  4. In the 'Custom column formula' field, paste the following M language code:
if [Info1] = "error" then "Info1" 
else if [Info2] = "error" then "Info2" 
else if [Info3] = "error" then "Info3"
else null

replace Info1, Info2, Info3 with your actual column names. Add or remove lines as necessary to match the number of columns in your table.

 

If this post helps to find solution would be happy if you could mark my post as a solution and give it a thumbs up

Best regards

Manoj Nair

Linkedin - https://www.linkedin.com/in/manoj-nair-%E2%98%81-344666104/

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors