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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
Community Champion
Community Champion

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
Super User
Super User

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.


[Tip] Keep CALM and DAX on.
[Solved?] Hit “Accept as Solution” and leave a Kudos.
[About] Chiel | SuperUser (2023–2) |

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.