Forum Discussion

doubleclick's avatar
doubleclick
Resolver I
4 months ago
Solved

Dynamic Axis Relabelling

HI all, 

Super difficult problem. 
I'm building a supplier scorecard, the supplier is the user. I need to show the their data whilst anonymising the other suppliers into Supplier1, Supplier 2, etc. 

 

I need to use this in a graph, so imagine there's the supplier spend on the Y, supplier name on the X, but the supplier name needs to be dynamic so it only shows the name of the selected supplier (via RLS but for now via a slicer) and for others it anonymises them by saying Supplier 2, Supplier 3, etc 

 

I've managed it on a row level context using a parameter, and can use that in a table, with some limitations, how can this be achieved???

  • No, a parameter table isn’t necessary for this. Parameter tables are typically used for switching measures, but it’s not needed here.

    For your situation, you only need a column with the labels use the real name for the selected supplier and (Supplier 1, 2…) for the others and place that on the X-axis.

     

    This makes the setup much simpler, as there’s no need for a parameter table.

     

    I hope this helps clarify things.

16 Replies

      • kushanNa's avatar
        kushanNa
        Super User

        doubleclick 

         

        The concept is similar to this tutorial: https://www.youtube.com/watch?v=lFd2hjkKz_Q

        However, I used DAX to create the tables. You need a table with a selection for each name, as well as anonymous entries like User1 and User2. Then group them using an index so that when you select a name from the index column, you only see the corresponding values.

        For coloring, I used the color function and a bar color measure. Based on the selected name, it colors the bars accordingly.

  • Hello,

    I’m not completely sure, but I think to build a separate dimension table for suppliers with the anonymised label precomputed, then use that on the axis and control visibility with measures

    Best regards,
    Daniele

     
    • doubleclick's avatar
      doubleclick
      Resolver I

      Not sure what you mean? Keep in mind there's about 5000 suppliers 

      • DanieleUgoCopp's avatar
        DanieleUgoCopp
        Super User

        the idea is you can’t make the X-axis itself truly dynamic with a measure, especially with 5000 suppliers, Power BI wants a physical column there what I meant is instead of trying to rename on the fly, you precompute something stable like a rank per supplier (for example by total spend), then use that rank to generate labels, so your logic becomes “if this is the selected supplier show real name, otherwise show Supplier + rank”,
        with 5000 suppliers you really don’t want to do this purely in measures, it’ll get slow and unpredictable, so better to create a helper table (or calculated column) that already contains SupplierID, Rank, and a default label like “Supplier 1, Supplier 2”, then your measure only swaps the label for the selected one

        Best regards,
        Daniele

  • Could you please confirm whether your issue has been resolved or if you’re still experiencing any difficulties?

    Your update would be helpful for the community and may assist others facing a similar issue.

  • Hi doubleclick ,

    We have not yet received any updates. Please let us know if you require any additional clarification or details from our side.

     

    Thank you.