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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Converting Excel Formula to Power BI

Hi,

 

I'm trying to replicate this formula (a calculated field within a Pivot table):

 

=IFERROR(IF(AND('Sales'=0,'Forecast'>0),0, 1-IF('ABS Error'/'Sales'>1,1,'ABS Error'/'Sales')),NA())

 

This is what I did (calculated column):

 

=IFERROR(IF(AND([Sales]=0,[Forecast]>0),0, 1-IF([ABS Error]/[Sales]>1,1,[ABS Error]/[Sales])),BLANK())

 

But I'm getting different figures for example the excel formula will show 63.8% but Power BI shows 629.8%

 

Any ideas what I might be doing wrong or how to write it better?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous Hey ,
Can tell your  requirement .what exactly are trying to achieve from this .

you can try this as a measure .

 

=IFERROR(IF(AND([Sales]=0,[Forecast]>0),1, 1-IF([ABS Error]/[Sales]>1,1,[ABS Error]/[Sales])),BLANK())

or 

=IFERROR(IF(AND([Sales]=0,[Forecast]>0),1-IF([ABS Error]/[Sales]>1,1,[ABS Error]/[Sales])),BLANK())


Try above formula

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous Hey ,
Can tell your  requirement .what exactly are trying to achieve from this .

you can try this as a measure .

 

=IFERROR(IF(AND([Sales]=0,[Forecast]>0),1, 1-IF([ABS Error]/[Sales]>1,1,[ABS Error]/[Sales])),BLANK())

or 

=IFERROR(IF(AND([Sales]=0,[Forecast]>0),1-IF([ABS Error]/[Sales]>1,1,[ABS Error]/[Sales])),BLANK())


Try above formula

 

Anonymous
Not applicable

Thank you, the first measure worked, I also needed to create sum measures of the columns used.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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