cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
juhayes Occasional Visitor
Occasional Visitor

New to Power BI

Quick Question,

 

I'm currently conducting a Profit Margin calculation where our company has costs associated with no sales on the same day. Thus, our Profit turns into a negative number for that day. I'm attempting to calculate the Profit Margin for that day but am getting an "-Infinity" result, I'm guessing from a 'divide by zero' error. Here is my formula, very simple:

 

ProfitMargin = Test_Sales[Profit]/Test_Sales[Revenue]

 

I've changed the formatting to percentage in BI Modeling etc. Just not sure where to go from here.

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
chrisu Member
Member

Re: New to Power BI

This seems like a good scenario for DIVIDE, which lets you account for divide by zero errors..  Like this:

 

ProfitMargin = DIVIDE(Test_Sales[Profit,Test_Sales[Revenue],0)

 

See: https://msdn.microsoft.com/en-us/library/jj677276.aspx

View solution in original post

Microsoft v-ljerr-msft
Microsoft

Re: New to Power BI

Hi @juhayes,

 

As chrisu have mentioned above, you should use DIVIDE Function (DAX) to perform the division in this scenario.Smiley Happy

 

Regards

View solution in original post

2 REPLIES 2
chrisu Member
Member

Re: New to Power BI

This seems like a good scenario for DIVIDE, which lets you account for divide by zero errors..  Like this:

 

ProfitMargin = DIVIDE(Test_Sales[Profit,Test_Sales[Revenue],0)

 

See: https://msdn.microsoft.com/en-us/library/jj677276.aspx

View solution in original post

Microsoft v-ljerr-msft
Microsoft

Re: New to Power BI

Hi @juhayes,

 

As chrisu have mentioned above, you should use DIVIDE Function (DAX) to perform the division in this scenario.Smiley Happy

 

Regards

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors