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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ifaizahmadkhan
New Member

Invalid Identifier Error

I am trying to create a Custom Column but getting an Invalid Identifier Error but not sure what the reason it's happening, also when I try to resolve it by deleting and inserting the headers then then the errors move from one place to another, and I need help to find the error please? Attached three SS fyr.

 

if List.Contains({[MOHAP Product Registration Status], [MAH Status], [#“M/S Status”], [DDC Status], [DOH Status], [Montaji Reg.status], [#“MOCCAE,ministry of climate change and environment registration status”]}, “Near Expiry”) then “Near Expiry” else if List.Contains({[MOHAP Product Registration Status], [MAH Status], [#“M/S Status”], [DDC Status], [DOH Status], [Montaji Reg.status], [#“MOCCAE,ministry of climate change and environment registration status”]}, “Expired”) then “Expired” else null

 

This is first error when i copy and paste formullaThis is first error when i copy and paste formullaThis when delete and add one columnThis when delete and add one columnThis is final place for errorThis is final place for error

 

2 REPLIES 2
rubayatyasmin
Super User
Super User

Hi, @ifaizahmadkhan 

 

your quotes shoould be straight like this "". you are using curly quotes. Below is the updated code

 

if List.ContainsAny({[MOHAP Product Registration Status], [MAH Status], #["M/S Status"], [DDC Status], [DOH Status], [Montaji Reg.status], #["MOCCAE, ministry of climate change and environment registration status"]}, {"Near Expiry"}) then "Near Expiry" else if List.ContainsAny({[MOHAP Product Registration Status], [MAH Status], #["M/S Status"], [DDC Status], [DOH Status], [Montaji Reg.status], #["MOCCAE, ministry of climate change and environment registration status"]}, {"Expired"}) then "Expired" else null

 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


ChielFaber
Solution Supplier
Solution Supplier

Dealing with errors is always a tricky business and time consuming. If you've already spent some time searching for the error without a solution I would advise you to create a (temporary) error report. You can then view the error record/row  and the accompanying error message. 

 

How to build an error report is perfectly explained by Radacad in the following blogpost:

https://radacad.com/exception-reporting-in-power-bi-catch-the-error-rows-in-power-query

 

I've used it myself and it works.

 

Hope this helps and gets you one step closer to your solution.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors