Forum Discussion
Sort Visual on Field Parameter
- 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
Select Your Visual:
- Click on the visual (chart or table) where you want to apply the sorting.
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.
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
- 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.
Thanks lbendlin I think this may be an issue/ feature - I have tried a few ways of sorting and it gets overwritten each time, this person seems to have had the same issue: https://github.com/MicrosoftDocs/powerbi-docs/issues/3827
As I mentioned one workaround is to enforce the sorting via the "sort a column by another column" assignment. With the aforementioned caveat that the default is wrong (in my opinion). If it seems not to work then you need to refresh the page/reset the filters too. There are still a few bugs to iron out with this feature.