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
Naveen_K_Gattu
New Member

Need Help with blanks/Error in table visual

I am converting an Excel report to Power BI. When I convert same formulas into DAX , some results are not similar to Excel.

Naveen_K_Gattu_2-1738747914766.png

 

 

Excel returns #DIV/0! error but Power BI returns blanks, when I use result of Formula B column in Formula D, it considers blanks as 0 and returns 7 as result, but user expects me to show blank or error here.

 

1 ACCEPTED SOLUTION
Sahir_Maharaj
Super User
Super User

Hello @Naveen_K_Gattu,

 

Can you please try this approach:

Formula A = DIVIDE(SELECTEDVALUE(Table[Column 2]), SELECTEDVALUE(Table[Column 1]))
Formula B = DIVIDE(SELECTEDVALUE(Table[Column 4]), SELECTEDVALUE(Table[Column 3]))
Formula D = IF(NOT(ISBLANK([Formula B])), ([Formula A] - [Formula B]) * SELECTEDVALUE(Table[Column 1]), BLANK())

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

View solution in original post

4 REPLIES 4
Naveen_K_Gattu
New Member

I was using if (column = blank(),..) to solve it but it wasn't giving me the correct result, my measure had multiple conditions, so I used  VAR and few ISBLANK conditions and got the expected results.

its strange that BLANK and ISBLANK dax returns different results.

Thank you for the response!

v-denglli-msft
Community Support
Community Support

Thanks for the reply from Sahir_Maharaj and sangeethray_92, please allow me to provide another insight.

Hi @Naveen_K_Gattu ,

 

Please try the following DAX.

Formula A = DIVIDE ( MAX ( 'Table'[Column2] ), MAX ( 'Table'[Column1] ) )
Formula B = DIVIDE ( MAX ( 'Table'[Column4] ), MAX ( 'Table'[Column3] ), "ERROR" )
Formula D = IFERROR ( ( [Formula A] - [Formula B] ) * MAX ( 'Table'[Column1] ), "ERROR" )

 

The final result is as follows. Hopefully it will meet your needs.

vdengllimsft_1-1738808042438.png

 

Please see the attached pbix for reference.

 

Best Regards,
Dengliang Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sangeethray_92
Frequent Visitor

Can tou try this : 


Formula B =
IF(
ISBLANK([Column 3]) || [Column 3] = 0,
BLANK(),
[Column D] / [Column 3]
)

Formula D =
IF(
ISBLANK([Formula B]),
BLANK(),
([Column E] - [Formula B]) * [Column A]
)

If this post helps, then please give Kudos and consider Accept it as a solution to help the other members find it more quickly.

Thank you.

Sahir_Maharaj
Super User
Super User

Hello @Naveen_K_Gattu,

 

Can you please try this approach:

Formula A = DIVIDE(SELECTEDVALUE(Table[Column 2]), SELECTEDVALUE(Table[Column 1]))
Formula B = DIVIDE(SELECTEDVALUE(Table[Column 4]), SELECTEDVALUE(Table[Column 3]))
Formula D = IF(NOT(ISBLANK([Formula B])), ([Formula A] - [Formula B]) * SELECTEDVALUE(Table[Column 1]), BLANK())

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

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 NL Carousel

Fabric Community Update - February 2025

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