Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Custom column in Power BI report

Hi, 

 

I have created power bi dashboard report which is pulling the data from SQL table and it's working great but I got a strange issue.

 

In report I have created a custom column and wrote a query to convert the text from Title column in to custom values.

 

If Title column contains  Manager then custom column dis[plays Manager

If Title contains Director then Director

If Title contains VP then VP

If Title contains CVP then CVP

If Title contains EVP then EVP

 

But if Title contains CVP/EVP then query is displaying VP only not CVP/EVP.

 

How to overcome this issue? Any idea would be greatly appreciated.

 

3 Replies

  • HotChilli's avatar
    HotChilli
    Community Champion

    Change the order of your 'if..then..else' comparisons.  Put the more selective tests further up (move the 'VP' test further down)

    • Anonymous's avatar
      Anonymous
      Not applicable

      Tried but no luck.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    For your reference:

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data