cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mbs2016 Regular Visitor
Regular Visitor

Need direction on how to convert an excel formula so it can be used in Power BI (scoring formula)

Below is an example of the formula|

 

=IFERROR(IF(SEARCH(K$3,$B4,1)>0,K$2,0),0)

 

Ultimatley trying to score data.  Example:  If Column 'A' has value of "Address1" then subtract 10 (out of 100), if  Column A has value of "ShipToAddress1" then subtract 20, etc.

 

5 REPLIES 5
Super User
Super User

Re: Need direction on how to convert an excel formula so it can be used in Power BI (scoring formula

@mbs2016 you can use search function

 

New Column  =
IF( SEARCH( Table[Col1], Table[Col2],, 0 ) > 0, Table[Col3], 0)





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Highlighted
mbs2016 Regular Visitor
Regular Visitor

Re: Need direction on how to convert an excel formula so it can be used in Power BI (scoring formula

Thank you for the prompt response.  Example of the spreadsheet I'm trying to convert for as more detailed example.

 

BCDEFGHI
 B100 -25-15-10-10
PI Team Comments-----ScoreSpacingAP_INVAP_POAP_SHIPAP_TAX
AP_ALL CORRECT 100 0000
AP_SHIPPING_M  90 00-100
AP_SHIPTO_I 90 00-100
AP_SHIPTO_I  90 00-100
AP_TAX_M 90 000-10
AP_TAX_I  |  AP_SHIPTO_M 80 00-10-10
AP_TAX_I  |  AP_SHIPTO_M 80 00-10-10
AP_TAX_M  |  AP_SHIPTO_M 80 00-10-10
AP_INV NUM_I | 75 -25000

 

Formul used to score the LAST row  = =IFERROR(IF(SEARCH(F$4,$B13,1)>0,F$3,0),0)

 

My concern is that the data was sourced from a SQL DB table and exported to Excel where the formulas were added.  The column that needs to be reported on is a free form text field that can have one of twelve possible values listed and a score is assigned to each.

 

For example:  Out off a total possible score of 100...

Possible values include "AP_INV" (If this value is present the subtract -25), "AP_SHIP" ( (If this value is present the subtract -10), etc.  

 

 

 

v-danhe-msft Super Contributor
Super Contributor

Re: Need direction on how to convert an excel formula so it can be used in Power BI (scoring formula

Hi @mbs2016,

Could you mean below is your sample data table:

B C D E F G H I
  B 100   -25 -15 -10 -10
PI Team Comments ----- Score Spacing AP_INV AP_PO AP_SHIP AP_TAX
AP_ALL CORRECT   100   0 0 0 0
AP_SHIPPING_M    90   0 0 -10 0
AP_SHIPTO_I   90   0 0 -10 0
AP_SHIPTO_I    90   0 0 -10 0
AP_TAX_M   90   0 0 0 -10
AP_TAX_I  |  AP_SHIPTO_M   80   0 0 -10 -10
AP_TAX_I  |  AP_SHIPTO_M   80   0 0 -10 -10
AP_TAX_M  |  AP_SHIPTO_M   80   0 0 -10 -10
AP_INV NUM_I |   75   -25 0 0 0

Could you please post your desired result if possible?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mbs2016 Regular Visitor
Regular Visitor

Re: Need direction on how to convert an excel formula so it can be used in Power BI (scoring formula

Is it possible to attach a copy of the Excel spreadsheet in this forum?

Super User
Super User

Re: Need direction on how to convert an excel formula so it can be used in Power BI (scoring formula

@mbs2016 youhave to post it on onedrive/google drive and share link.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 315 members 3,071 guests
Please welcome our newest community members: