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
AshDil
Helper V
Helper V

A division by Zero has been encountered

Hi,

I have connected to Power bi dataflow, and created following measure

Average Price =
CALCULATE ( AVERAGE ( 'Table'[Sales] ) )
/ CALCULATE ( AVERAGE ( 'Table'[Std. Rate] ) )
I'm facing division by zero error with the above formula. The below are the error details.
MdxScript(model) (5,75) calculation error in measure: 'Table'[Average Price]): A division by Zero has been encountered.
The same formula and same connection used by my colleague, she didn't faced any error.

I know Divide() will avoid division by zero errors, but I wanted to know why I'm facing error why not my colleague with same formula and connection.

Please let me know the reason for it.

 

Thanks,

AshDil.

 

 

1 REPLY 1
amitchandak
Super User
Super User

@AshDil , create these two measures separately and put in viusal, I think it is because some filter

 

better to do like

Divide( CALCULATE ( AVERAGE ( 'Table'[Sales] ) )
,  CALCULATE ( AVERAGE ( 'Table'[Std. Rate] ) ) )

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.