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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
srini_vasan
New Member

Unable to write iferror syntax

I Tried to write below simple syntax but somehow i am not getting Table.Profie field for writing this syntax. Here i have attached PBIX file, Please help me here to find where went wrong

 

DIVIDE(Table.Profie, Table.Revenue)

 

iferror_post.pbix

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

HI @srini_vasan ,

 

If you are doing a measure you need to aggregations on your calculation you can do one of two approachs:

 

Create metrics for Profit, Revenue and the Division

Profit = SUM('Table'[Profit])
Revenue = SUM('Table'[Revenue])
Measure = DIVIDE([Profit], [Revenue])

Create a single metric

Measure = DIVIDE(SUM('Table'[Profit]), SUM('Table'[Revenue]))

MFelix_0-1737047783767.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks for the reply from MFelix , please allow me to provide another insight: 

Hi  @srini_vasan ,

 

I can't open your PBIX, presenting the following message, you can put the error message in the form of a picture:

vyangliumsft_0-1737082222123.png

IFERROR function to catch function error information, if the expression result is correct then return value, if not then return a customized value, you can follow the link below to see the information about IFERROR function, check if it is in DirectQuery mode or the parameters inside the IFERROR function must be the same data type.

IFERROR function (DAX) - DAX | Microsoft Learn

Appropriate use of error functions in DAX - DAX | Microsoft Learn

 

Calculater Column:

Profit Margin = IFERROR([Profit] / [Sales], 999)

Measure:

Profit Margin_measure = IFERROR(MAX('Table'[Profit]) / MAX('Table'[Sales]), 999)

vyangliumsft_1-1737082222124.png

 

 

Best Regards,

Liu Yang

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

MFelix
Super User
Super User

HI @srini_vasan ,

 

If you are doing a measure you need to aggregations on your calculation you can do one of two approachs:

 

Create metrics for Profit, Revenue and the Division

Profit = SUM('Table'[Profit])
Revenue = SUM('Table'[Revenue])
Measure = DIVIDE([Profit], [Revenue])

Create a single metric

Measure = DIVIDE(SUM('Table'[Profit]), SUM('Table'[Revenue]))

MFelix_0-1737047783767.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.