cancel
Showing results for
Did you mean:
Frequent Visitor

## DAX for a tooltip visual

Hello,

I have a horizontal bar chart displaying the number of story points completed by area.

I want to create a tooltip that includes a pie chart allowing the user to get a visual representation of the percentage of items that are in the area hovered for the tooltip.

So, if there are 5,000 items in the "Operations" area out of 20,000 total items and the user hovers over the "Operations" bar they will get a tooltip that includes a pie chart with a 25% slice for "Operations" and the remainder of the pie filled in a different color.

Hoping this makes sense. If anyone has an idea I would love to hear back.

Thanks!

1 ACCEPTED SOLUTION
Frequent Visitor

I got this one figured out!

I created these 3 measures:

Total = CALCULATE( SUM ( 'Sheet1'[StoryPoints] ) , ALL ( 'Sheet1'[AreaLevel] ) )
Selected = CALCULATE(SUM ( 'Sheet1'[StoryPoints] ) , ALLSELECTED ( 'Sheet1'[AreaLevel] ) )
NotSelected = CALCULATE( [Total] - [Selected] )

Then, I put the Selected and NotSelected measures in the pie chart Values. Voila! I still have a little formatting to do, but this is working great!
5 REPLIES 5
Super User

I'm wonderin if you are talking about something like this, I know you were asking about DAX, just to make sure that I understand "the output" you are looking for:

If so, pleae provide some sample data that allows to create the DAX.

Regards,
Tom

Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Frequent Visitor

Hey @TomMartens , that's so close to what I was thinking. I was thinking DAX would be needed because in my perfect world the pie would show the percentage of, say "Computers" from your screenshot as dark blue and then, the rest of the pie would be grey for all others. The reason for wanting that is because the user is only interested in seeing how much of the total is "Computers" (again, just from your example) versus all other categories. It wouldn't be necessary to see all the slices of all the categories. I also think DAX would be helpful for a title on the tooltip to display the category being hovered over.

I have an Excel file with a small set of aggregated data. Can I send that to you? I don't see an option to add an attachment here so I'm including screenshots of the data and two charts. One horizontal bar chart for the Main Chart and a Tooltip Chart for what I'm thinking about. The Tooltip Chart is what you would see if you hovered over "Operations" from the Main chart.

Thanks for any guidance here!

Frequent Visitor

Hello, just wanted to bump this one. Anyone have any ideas?

Thanks!

Super User

Regards,

Tom

Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Frequent Visitor

I got this one figured out!

I created these 3 measures:

Total = CALCULATE( SUM ( 'Sheet1'[StoryPoints] ) , ALL ( 'Sheet1'[AreaLevel] ) )
Selected = CALCULATE(SUM ( 'Sheet1'[StoryPoints] ) , ALLSELECTED ( 'Sheet1'[AreaLevel] ) )
NotSelected = CALCULATE( [Total] - [Selected] )

Then, I put the Selected and NotSelected measures in the pie chart Values. Voila! I still have a little formatting to do, but this is working great!

Announcements

#### Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

#### Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors