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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Alusine_Kamara
Helper II
Helper II

Measures

Good morning everyone from Sierra Leone, West Africa.

Given these two measures: 

GDP per Capita2 = [GDP]/[Population]
GDP par Capita = DIVIDE(Indicators[GDP],Indicators[Population],0)
The GDP and Population are measures, both of them captured in the same column (Indicator) of a table called Indicators but, with different codes.
These two measures generate the same results in a visual.
Is there a difference between these two measures and would I be correct to use either in similar situations.
How I wish I could send the .pbix file to make things easy. I am working on it. Hope my question makes sense. Thanks.
1 ACCEPTED SOLUTION
Vallirajap
Resolver III
Resolver III

Hii @Alusine_Kamara 
Error handling is the major difference between the with or without divide function,

1. The "Divide" 
function is designed to handle division by zero errors. helping to avoid potential errors in your calculations.
2. The division operator ("/") is more concise for simple division operations without the need for explicit error handling.

mes1 = DIVIDE(1, 0, 0)   //Returns 0 if the divisor is 0
mes2 = 1 / 0   //Results in an error

This is useful means mark as a solution and hit the kudo

Thank you

View solution in original post

2 REPLIES 2
Alusine_Kamara
Helper II
Helper II

Thank you very much.

Vallirajap
Resolver III
Resolver III

Hii @Alusine_Kamara 
Error handling is the major difference between the with or without divide function,

1. The "Divide" 
function is designed to handle division by zero errors. helping to avoid potential errors in your calculations.
2. The division operator ("/") is more concise for simple division operations without the need for explicit error handling.

mes1 = DIVIDE(1, 0, 0)   //Returns 0 if the divisor is 0
mes2 = 1 / 0   //Results in an error

This is useful means mark as a solution and hit the kudo

Thank you

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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