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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
yaz_d89
Regular Visitor

DAX equvalent of Excel 'ISNA' formula?

Hi,

 

Does the ISNA function held in Excel have an equvalent in Power Bi Desktop? Have tried ISERROR, and various others, however, can't find one that works. I have a data source in Excel which I'm trying to move to Power BI, however, a lookup based on ISNA can't be replicated in the same way.

 

Thanks,

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @yaz_d89,

 

In Excel, the #N/A error is returned when the lookup functions can't find a referenced value. In Dax, a BLANK is returned instead of #N/A error when there is no match that satisfies all the search values in LOOKUPVALUE Function (DAX). In this scenario, ISBLANK Function (DAX) should be equivalent of ISNA function in Excel.

 

In addition, there is another difference between lookup functions(VLOOKUP, HLOOKUP, LOOKUP, or MATCH) in Excel and LOOKUPVALUE Function (DAX): If several rows in your table match your criteria, then lookup functions in Excel will only return the first (or last) match. On the contrary, LOOKUPVALUE in DAX may return an error if several rows match your criteria. In this scenario, you may need to use TOPN Function (DAX)  to mimic the behaviour of lookup functions in Excel.

 

Reference: https://thedataspecialist.wordpress.com/tag/lookup-in-dax/

 

Regards

View solution in original post

2 REPLIES 2
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @yaz_d89,

 

In Excel, the #N/A error is returned when the lookup functions can't find a referenced value. In Dax, a BLANK is returned instead of #N/A error when there is no match that satisfies all the search values in LOOKUPVALUE Function (DAX). In this scenario, ISBLANK Function (DAX) should be equivalent of ISNA function in Excel.

 

In addition, there is another difference between lookup functions(VLOOKUP, HLOOKUP, LOOKUP, or MATCH) in Excel and LOOKUPVALUE Function (DAX): If several rows in your table match your criteria, then lookup functions in Excel will only return the first (or last) match. On the contrary, LOOKUPVALUE in DAX may return an error if several rows match your criteria. In this scenario, you may need to use TOPN Function (DAX)  to mimic the behaviour of lookup functions in Excel.

 

Reference: https://thedataspecialist.wordpress.com/tag/lookup-in-dax/

 

Regards

Greg_Deckler
Super User
Super User

 

MyColumn = IF([Column]="#N\A",1,0)

?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors