Forum Discussion

rpinxt's avatar
rpinxt
Icon for Solution Sage rankSolution Sage
2 years ago
Solved

Do a TopN on a field parameter measure

I have this field measure: prmMeasure = {     ("Tot.LC", NAMEOF('Metrics'[Tot.LC]), 0),     ("Tot.GC", NAMEOF('Metrics'[Tot.GC]), 1),     ("Quantity", NAMEOF('Metrics'[Quantity]), 2) }   So t...
  • rpinxt's avatar
    2 years ago

    Ok I have been able to fix it.

    Using a ranking based on the variable field parameters I was able to create a top 10:

    So the second column is variable and takes the measure that is chosen in the slicer.

    To make this work I had to add a copy/dummy field in my field parameter:

    If you use the first column in the parameter you get errors in coming formulas.

     

    Made the rank like :

    So 1 var to determine what the choise was.

    Then 3 other vars for every single option of choise.

     

    With a switch you can then contol the rankx on which selected value from the field parameter options.

    Then you have a field that ranks the selected measure from 1 to xxxx.

     

    Only thing you then need to do is to put a filter on where you only show 10 or less :

    Then I think the only option we have is for the visual to switch off word wrap on the headers and on the values.

    After yoi can manually make the column Rank_Measure very small so it will not show.

     

    ps: if somebody knows a better way to hide a column in a table visual please let me know!