Forum Discussion

sudhakar111's avatar
sudhakar111
Helper IV
7 years ago
Solved

Display Percentages in tool tips

Hello,

 

I am facing an issue while displaying percentages in tool tips. We have one product and that product has sub products.

 

The percentage calculation should be how much percentage is each sub products contribution against the overall total. 

 

If i do a calculation in a table displaying the sub products and the measure like Quantity/Sum(Quantity) it gives me the correct

 

results. We are using a bar chart for Sub products and a tool tip which should display the percentage against the overall total.

 

when mouse over on the sub product it is displaying 100% for all sub products. The tool tip is ignoring the overall total and the

 

numerator and denominator are showing the same values.

  • Hi sudhakar111

    To display a tooptip in a text box,

    1.you could create a new report and add card visual on the report,

    2.then create a new measure like this

    Measure 2 = CALCULATE(SUM(Sheet3[BILLED_QTY]),ALLEXCEPT(Sheet3,Sheet3[sales office]))/CALCULATE(SUM(Sheet3[BILLED_QTY]),ALL(Sheet3))

    3.add this measure to the card visual,

    4.set this page as a tooltip by cilck on Format->Page information->turn on tooltip

    5. cilck on the bar chart with sales office, then click on Format->turn on tooltip->select the page your card visual display

    finally, when you mouse over the bar chart,you would see the card visual displaying as a tooltip.

     

    Reference:

    https://docs.microsoft.com/en-us/power-bi/desktop-tooltips

     

    Best Reagrds

    Maggie

     

     

7 Replies

  • Baskar's avatar
    Baskar
    Resident Rockstar

    can you please share some sample screen and dummy datas.

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi sudhakar111

    Please refer to my pbix to see the proper Percentages in tool tips.

    Assume your table is like below, then create a measure as below

    measure =
    CALCULATE ( SUM ( Sheet3[quantity] ), ALLEXCEPT ( Sheet3, Sheet3[subproduct] ) )
        / CALCULATE ( SUM ( Sheet3[quantity] ), ALLEXCEPT ( Sheet3, Sheet3[product] ) )

     

    Best Regards

    Maggie

    • sudhakar111's avatar
      sudhakar111
      Helper IV

      Thanks a lot v-juanli-msft,

       

      That worked perfectly. I have a different issue in the same context. I need to display the tool tip in a text box.

       

      i have one dimension now which is a sales office. Using the below formula i am able to see the percentage contribution for each Sales Office in a table. The requirement is i need to display the percentage of the sales office in a text box when moused over on a bar chart with sales offices. The below formula shows 100% for each sales office when moused over.

       

      Percentage = (sum(SALES[BILLED_QTY])/CALCULATE(sum(SALES[BILLED_QTY]),ALLSELECTED(SALES[SALES_OFFICE])))*100

      • v-juanli-msft's avatar
        v-juanli-msft
        Community Support

        Hi sudhakar111

        To display a tooptip in a text box,

        1.you could create a new report and add card visual on the report,

        2.then create a new measure like this

        Measure 2 = CALCULATE(SUM(Sheet3[BILLED_QTY]),ALLEXCEPT(Sheet3,Sheet3[sales office]))/CALCULATE(SUM(Sheet3[BILLED_QTY]),ALL(Sheet3))

        3.add this measure to the card visual,

        4.set this page as a tooltip by cilck on Format->Page information->turn on tooltip

        5. cilck on the bar chart with sales office, then click on Format->turn on tooltip->select the page your card visual display

        finally, when you mouse over the bar chart,you would see the card visual displaying as a tooltip.

         

        Reference:

        https://docs.microsoft.com/en-us/power-bi/desktop-tooltips

         

        Best Reagrds

        Maggie