This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I have a simple table visual that I am using in a tooltip that needs to be sorted, but the requirement is not to sort it by default in either ascending or descending order by a certain value, but rather to sort it in either ascending or descending order dynamically depending on a field value for the row the user hovers over. The field is called 'Direction', and if the Direction value for that row is 'Up', I want the rows in the tooltip to be sorted by the measure in ascending order; and if the Direction is 'Down', I want the rows sorted by the measure in descending order. The Direction value will always be either 'Up' or 'Down' for every record in the tooltip visual, whenever the user hovers over the row in the table. Currently I am sorting it in descending order by the measure, but depending on the record the user hovers over, they may need it sorted in ascending order.
Solved! Go to Solution.
I was able to get this to work by just creating a dynamic rank measure, then adding it to the tooltip visual, then sorting the visual in ascending order by this rank measure. This is the DAX code for the measure:
I was able to get this to work by just creating a dynamic rank measure, then adding it to the tooltip visual, then sorting the visual in ascending order by this rank measure. This is the DAX code for the measure:
Hi @ldwf,
Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to @danextian & @Shravan133 for sharing valuable insights.
Could you please confirm if your query has been resolved by the provided solutions? This would be helpful for other members who may encounter similar issues.
Thank you for being part of the Microsoft Fabric Community.
Hi @ldwf
Power BI does not have awareness of which measure is being hovered in a table or matrix visual. A common workaround is to use a matrix visual and format it to look like a table, combined with a disconnected table that holds the measure names and is referenced in a separate column. For this to work, the measure name field must be used in the column headers so the visual can establish context.
That said, this approach comes with limitations, most notably that the measure name column cannot be positioned between other columns, which can restrict layout flexibility.
Please see the attached sample pbix.
Instead of trying to toggle ascending/descending sorting, you convert everything into a single sorting column where the logic flips the sign when needed.
Step 1: Create a sort measure
Assume your main measure is: [MyMeasure]
Dynamic Sort Value =
VAR Dir = SELECTEDVALUE('Table'[Direction])
RETURN
IF(
Dir = "Up",
[MyMeasure], -- ascending behavior
-[MyMeasure] -- descending behavior
)
Step 2: Use this in the tooltip table
In your tooltip table visual:
Power BI always sorts ascending internally, but:
So:
Step 3: Set sorting
In the tooltip visual:
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 26 | |
| 25 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 42 | |
| 41 | |
| 40 | |
| 21 | |
| 20 |