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

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.

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
Employee
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
Employee
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)

?


@ 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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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