Power BI Exchange

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
 View Only
  • 1.  Return Text based on Negative Price and Positive Price

    Gold Contributor
    Posted Aug 25, 2022 06:59 AM
      |   view attached
    Hello,

    Please refer attached excel for your reference.

    I'm looking to get a specific text against Negative Price and Positive Price.

    Need a calculated column - where if the Prices from Column B and Column C i.e. Price 1 and Price 2 are greater than 0 or Positive price, it should return a text as
    "Nominated for Price" else "Better Luck Next Time".

    Basically if Price are Positive "Nominated for Price" and if Prices are Negative "Better Luck Next Time".

    Please advise. Thanking you in advance.

    ------------------------------
    Prakash M
    ------------------------------

    Attachment(s)

    xlsx
    Text based on value.xlsx   11 KB 1 version


  • 2.  RE: Return Text based on Negative Price and Positive Price

    Posted Aug 25, 2022 08:38 AM

    Hi Prakash,

    Are you looking to have a formula in your excel file or somewhere else? My initial understanding is just to insert one column in your excel file and create an "If" statement such as below:

    Regards,
    RD



    ------------------------------
    Ardie Trinidad
    Senior Finance Analyst
    ------------------------------



  • 3.  RE: Return Text based on Negative Price and Positive Price

    Gold Contributor
    Posted Aug 25, 2022 09:48 AM
    Hi Ardie,

    No, I'm not looking for a solution into excel (which I'm already aware of)

    I'm looking to have a logic into my Power BI Dashboard.

    ------------------------------
    Prakash M
    ------------------------------



  • 4.  RE: Return Text based on Negative Price and Positive Price

    Posted Aug 26, 2022 01:42 AM
      |   view attached
    Hi Prakash,

    You can use "Concatenate" formula. Attached is the simple example.

    Regards,
    RD

    ------------------------------
    Rd 3nidad
    Senior Finance Analyst
    ------------------------------

    Attachment(s)

    pbix
    Text Values.pbix   27 KB 1 version


  • 5.  RE: Return Text based on Negative Price and Positive Price

    Posted Aug 27, 2022 07:29 PM
      |   view attached
    @Prakash Mangalwadekar,
    There are a couple of different ways that you can do this.  Here are two ways, and both are very similar to how you would do it in Excel.

    The first way, would be to create a new custom column in the Query Editor, and it would look like this:


    The second would be to create the column in Dax, and it would look like this:


    Either way you do it, the result will be the same, as you can see:

    Hope that helps.

    Kaz.

    ------------------------------
    Kaz Shakir
    Sr. Program Manager, Asset Planning
    TN
    ------------------------------

    Attachment(s)

    pbix
    TextBasedOnValue.pbix   27 KB 1 version


  • 6.  RE: Return Text based on Negative Price and Positive Price

    Gold Contributor
    Posted 30 days ago
    @Kaz Shakir,

    Thank you for your help.

    Whereas when we use the Dax column as a Slicer, the Price 1 and Price 2 do not come up correctly.

    For instance, when we select "Nominated for Price", the Price 1 should sum to $3.24 and Price 2 should sum to $2.22.

    Similarly when we ​select, "Better Luck Next Time", Price 1 should sum to $0.72 and Price 2 as $$0.17.

    My Apologize! I was ​in an impression, if we get what I was actually required, I would had been able to Slice after creating a column.​

    ------------------------------
    Prakash M
    ------------------------------



  • 7.  RE: Return Text based on Negative Price and Positive Price

    Posted 29 days ago
      |   view attached
    @Prakash Mangalwadekar,

    I see what you are trying to accomplish now.  You do not want a calculated column.  You need to break up your data into two tables, and then create a new table.  Here's a screenshot of what your data should look like:

    You could create those tables in excel, or you can take your single table (as you have it now), and do this work in the Transform Data section of Power BI.  That's what I did.  When you open the attached file, just look in the Transform Data section, and you can see the steps involved to create these three tables from the one table you currently have.

    Once you have these three tables, then you need to create a relationship between them.  Here is how the data model should look:

    Now, you can create the slicer and the total results you are looking for:



    Please let me know if that accomplishes what you wanted.

    Kaz.

    ------------------------------
    Kaz Shakir
    Sr. Program Manager, Asset Planning
    TN
    ------------------------------

    Attachment(s)

    pbix
    TextBasedOnValue_r2.pbix   38 KB 1 version