Forum Discussion

alecev's avatar
alecev
Frequent Visitor
1 year ago

Another IF with SELECTVALUE not working

Hi,

I'm facing a problem since days that i cannot solve.

I found some similar help messages in this forum with "IF with SELECTVALUE" in the object, but no one helped me to solve mine.

My problem is that I have a list of suppliers with Names, IDs and a Score:

IDNameScore
3498751   Supplier Name 1    2,17
3952340Supplier Name 24,16
7092052Supplier Name 34,33
9700018Supplier Name 44,32
7511869Supplier Name 55,87
577385Supplier Name 66,14
7282137Supplier Name 74,33
6997920Supplier Name 85,03
472806Supplier Name 94,16

I can show an histogram with names (on X) and scores (on Y) or IDs (on X) and scores (on Y).

But I need a different view: I need to show all scores in y-axis, and all IDs in the x-axis, except that one that i want to show with its Name, example:

 

I need this view when I have to show to "Supplier Name X", its score compared to other suppliers, without let him know who are other suppliers.

So I created a second table with only Supplier Names, using it to select in the slider.
Then I created a new x-axis column in the following way: 
IF('Supplier Table'[Names] = SELECTEDVALUE('Supplier Names'[Names],""), 'Supplier Table'[Names], 'Supplier Table'[IDs])
but it does not work.
Any ideas how to solve?
 

3 Replies

  • alecev Create a new calculated column in your 'Supplier Table' to determine whether to show the Name or the ID based on the selected supplier.

    DAX
    NewXAxis =
    IF(
    'Supplier Table'[Names] = SELECTEDVALUE('Supplier Names'[Names], ""),
    'Supplier Table'[Names],
    'Supplier Table'[IDs]
    )

    Use this new column as the x-axis in your visualization.

     

    • alecev's avatar
      alecev
      Frequent Visitor

      sorry but it is exactly what I tried and did not work.

    • alecev's avatar
      alecev
      Frequent Visitor

      Updated post with link to pbix