Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Sorting by Spend column in a dynamic metric setting

Hello, 

 

One of the request faced by my stakeholder is wanting the ability to select only certain columns to show in a table visual. To accomodate this need, I have used DAX to create a metrics table (called Metrics_Slicer in the attached), and then used a measure (called Selected Metric Value in the attached) to allow them to select what they want to see on the visual. 

 

However, the stakeholder also require it to be sorted by spend (see the Original tab). I cannot seem to do this but it is an essential requirement. Is there a way around this please? 

 

Link to the file is here: https://drive.google.com/file/d/1k7ywA75Xc2gE48VOgWWT_-yl05bjt6AT/view?usp=sharing

 

Thanks in advance.

  • HI Anonymous ,

    I don't think you can sort your columns individually using this approach. Seeing your report, I understood that the sort happens based on the total column. One more thing is you are keeping it as text, so the sort also is going to happen based on character. i.e. 85 will be greater than 600.

     

    Instead you can go ahead with the approach of using Field Parameters for this.

     

    Refer the Page 1 in the file attached here

    Regards,

4 Replies

  • Sorting by a measure won't be allowed, but you can use RANKX with ALLSELECTED() to create a ranking measure and than try to sort the table based on this rank measure.

  • HI Anonymous ,

    I don't think you can sort your columns individually using this approach. Seeing your report, I understood that the sort happens based on the total column. One more thing is you are keeping it as text, so the sort also is going to happen based on character. i.e. 85 will be greater than 600.

     

    Instead you can go ahead with the approach of using Field Parameters for this.

     

    Refer the Page 1 in the file attached here

    Regards,

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Thejeswar, this works but I can't seem to replicate your table MeasureSelector using NAMEOF. How is this done please. Thanks.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I got it, thanks, it works perfectly! Will mark as Accept as solution