Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Sort Visual on Field Parameter

I have just added a Field Parameter to my report to allow a visual to switch between Date, Week and Month with Week and Month as Calculated Columns in a table. It works great with the slicer changing...
  • magiccharts's avatar
    magiccharts
    2 years ago

    Step by step solution:

    Step 1: Create the Blank Measure

      • Go to the "Modeling" tab in Power BI Desktop.
      • Click on "New Measure."
      • Name the measure (e.g., SortBlankMeasure) and use the following DAX formula:

         

        Create a New Measure:
       
      SortBlankMeasure = BLANK()

    Step 2: Add the Blank Measure to the Chart

    1. Select Your Visual:

      • Click on the visual (chart or table) where you want to apply the sorting.
    2. Access the Fields Pane:

      • In the Visualizations pane on the right side, you'll see a section called "Fields."
      • This section shows the fields and measures currently used in the visual.
    3. Add the Blank Measure to the Tooltip:

      • Scroll down to find the "Tooltip" area within the Fields section.
      • Drag the SortBlankMeasure from the Fields list and drop it into the "Tooltip" section.

      Note: The Tooltip section is usually at the bottom of the Fields pane. If you don’t see the Tooltip section, it’s possible that the visual you’re using doesn’t support tooltips, in which case this method may not be applicable.

    Step 3: Sort the Visual by the Blank Measure

    1. Sort the Visual:
      • Once the blank measure is added to the Tooltip, click on the three dots (ellipsis) at the top-right corner of the visual to access the "Sort by" options.
      • You should now see the SortBlankMeasure as one of the sorting options.
      • Choose to sort the visual by SortBlankMeasure.