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.
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.
I cannot believe this magic works like a charm! 😊
magicchart, you have saved all PBI developers around the world who were frustrated, scratching their heads, and wondering why this seemingly minor bug has not yet been fixed by one of the world's most magnificent companies.
In the age of Gen AI, I am not sure if they would guide me to a solution like this... Anyway, thanks a ton! magiccharts