Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Looking to Replicate Excel Formulas into PBI

Hi, First and foremost I am relatively new to using PowerBI, however I am currently trying to replicate formulas in the following .xlsx file under Columns E-K into PowerBI. What would the best way b...
  • dharmendars007's avatar
    1 year ago

    Hello Anonymous , 

     

    There are N/A and 0 in your spreadsheet how ever when am trying to see the formula in Column E, I assume it is a Conditinal colum , Therefore either you can use If condition or Switch Statement in Power BI as calculated column to create this, here is a example code you can try..

     

    Product Name =
    SWITCH(TRUE(),
    CONTAINSSTRING([C], "Half-Gallons"), "Half-Gallons",
    CONTAINSSTRING([C], "Pints"), "Pints",
    CONTAINSSTRING([C], "Minis"), "Minis",
    CONTAINSSTRING([C], "Three-Gallon"), "Three-Gallons",
    CONTAINSSTRING([C], "3 Gallon"), "Three-Gallons",
    BLANK())

     

    If you find this helpful , please mark it as solution and Your Kudos are much appreciated!

     

    Thank You

    Dharmendar S

    LinkedIN