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
Valley_Girl
Helper I
Helper I

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

@Valley_Girl 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

@Valley_Girl 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

 

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

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.

Top Solution Authors