Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Dynamic Measure when hovered over Stacked Bar Graph

Hi,

 

I have created a horizontally stacked bar graph, the stack is the percentage of the duration attended by the guest of the event. I want to calculate the percentage of guests who were in the show for each category. I have written a measure but it is static, is it possible to make it dynamic when I hover over the stacked graph.

 

I can create a tooltip to see the result when I hover but I am not sure how to create the dynamic measure or a measure that would support the tooltip when hovered over the graph.

 

PCT = CALCULATE(COUNT('Table'[ID]),FILTER('Table','Table'[Pct Activity Category] = "76% - 100%"))/COUNT('Table'[ID])
 
 
Unable to Post the Image, posting the sample Data
 
ID      ||    Title                        ||     Category              ||  Pct Activity Category ||
1             Kevin Hart                     Comedy                    76% - 100%
2             Dave Chappelle             Comedy                    76% - 100%
3             Kevin Hart                     Comedy                    Less Than 10%
4             Dave Chappelle             Comedy                    10% - 25%
5             Eddie Murphy                Comedy                    76% - 100%
6             Eddie Murphy                Comedy                    76% - 100%
7             Kevin Hart                      Comedy                    51% - 75%
8             Kevin Hart                      Comedy                    10% - 25%
9             Dave Chappelle              Comedy                    26% - 50%
10           Eddie Murphy                 Comedy                    26% - 50%
 

Please go to the link to get sample data and a screenshot

Sample Data Link 

 

I am trying to find the percentage of guest attendance based on pct Activity Category when I hover on the graph. For Example, if I hover on Kevin Hart 76% - 100% cat, I must see a tooltip 23%(I know how to do the tooltip but I don't know how to write a dynamic measure which depends on hover), the same should happen for other categories.

 

Kevin Hart:

Total Guest: 21

Less Than 10% - 9.5%

10% - 25% - 14.2% 

26% - 50% - 9.5%

51% - 75% - 23%

76% - 100% - 23%

  • parry2k's avatar
    parry2k
    6 years ago

    Anonymous try this measure

     

    PCT = DIVIDE ( COUNT('Sheet1'[Guest ID] ), CALCULATE ( COUNT ( Sheet1[Guest ID] ), ALLSELECTED ( Sheet1[Pct Activity Category] ) ))

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

8 Replies

  • Anonymous Can you share sample data with some screenshot, and what you are trying to achieve.

    • Anonymous's avatar
      Anonymous
      Not applicable

      parry2k Sure, I couldn't attach a screenshot, so I have uploaded it on the drive and shared the link on the Main Post.

       

      • parry2k's avatar
        parry2k
        Super User

        Anonymous try this measure

         

        PCT = DIVIDE ( COUNT('Sheet1'[Guest ID] ), CALCULATE ( COUNT ( Sheet1[Guest ID] ), ALLSELECTED ( Sheet1[Pct Activity Category] ) ))

         

        I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!