Forum Discussion

Nazdac911's avatar
Nazdac911
Icon for Helper II rankHelper II
3 years ago
Solved

Using DAX, not calculated columns. Getting another value if text column contains specified value

Hi All 

I faced the following challenge

From the following virtual table I want to be able to filter through 3 slicers [ City , Store, Category]

and then showing the following results:

 

  • Field: Shows a different values than the existing values depend on conditional equation (Switch or If)
  • Profit: Sum(table[Profit])
  • Units: Changes depends on slicers

The challenge is to be able to change the column values depend of their contents and  show updated values in the resulted table.

PS, I don’t have permission to create calculated columns , so this should  be done with DAX measures.  

Thanks in advance 

Regards 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Nazdac911 ,

     

    Is it probably similar to this format?(the data I use are different from yours)

    create the following measure:

    PRD = IF('Table'[field]="product 1 high quality","PRD 1",IF('Table'[field]="product 2 high quality","PRD 2","PRD 3"))
    profits = CALCULATE(SUM('Table'[profit]),FILTER(ALL('Table'),'Table'[PRD]=SELECTEDVALUE('Table'[PRD])))

     

    You can also refer to my pbix file for better understanding.

     

    Best regards,

    Community Support Team Selina zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

3 Replies

  • Nazdac911 , Can you give example of what values you want to show here

     

    • Field: Shows a different values than the existing values depend on conditional equation (Switch or If)

     

    • Nazdac911's avatar
      Nazdac911
      Icon for Helper II rankHelper II

      Thanks for the fast reply 

      For example : if I have "Product 1 high quality value " then show in the report "Prd 1" 

      in other word , insted of draging a column to the table visual , i need to use a mesure that will change tests in the column

      I hope this answer your question 🙂 

      Looking forward hearing form you

      Regards

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Nazdac911 ,

         

        Is it probably similar to this format?(the data I use are different from yours)

        create the following measure:

        PRD = IF('Table'[field]="product 1 high quality","PRD 1",IF('Table'[field]="product 2 high quality","PRD 2","PRD 3"))
        profits = CALCULATE(SUM('Table'[profit]),FILTER(ALL('Table'),'Table'[PRD]=SELECTEDVALUE('Table'[PRD])))

         

        You can also refer to my pbix file for better understanding.

         

        Best regards,

        Community Support Team Selina zhu

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly