Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
AdamBCBSNE
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!
Adam

1 ACCEPTED SOLUTION

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!
2019-12-19_13-27-38.png

View solution in original post

5 REPLIES 5
TomMartens
Super User
Super User

Hey @AdamBCBSNE ,

 

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:

image.png

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

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.

 

data.pngmain.pngtooltip.png

 

Thanks for any guidance here!
Adam

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

Thanks!

Hey @AdamBCBSNE ,

 

please upload the pbix with sample data to onedrive or dropbox and share the link.

 

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

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!
2019-12-19_13-27-38.png

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors