Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Using Conditional Formatting in A Tooltip, based on the measure hovered

I have a bar chart with 4 measures over time. I am trying to build a measure that displays the numerator of a calculation, based on what the user hovers over.  

For example:
if user hovers over measure 1, then show numerator of measure 1
if user hovers over measure 2, then show numerator of measure 2 etc..  

 

However when I do this and place it in the tooltip, nothing shows up. I'm sure I'm doing something wrong, but can't figure out quite what I need to do.

Here is what I built:

 


In the visual below, when I place the new measure into the tooltip, I would expect there to be another item below the "Actual Qty - CE" row that displays my new measure:

 



  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    Hope everything is going well.

     

    The following is a step -by -step guide for creating a dynamic attitude value for Tooltips:

     

    Create a measure for each molecule:

    Numerator_Measure1 = SUM('SalesLT SalesOrderDetail'[UnitPrice])
    Numerator_Measure2 = SUM('SalesLT Product'[StandardCost])

     

    First, make sure that each computing molecule has a separate measure.

     

    Create a new table "Table" and associate the 4 degree value with the value in the table. Different Measure is displayed according to different values in the table.

    Measure = SWITCH(SELECTEDVALUE('Table'[log]),"log1",[Numerator_Measure1],"log2",[Numerator_Measure2],"log3",[Numerator_Measure3],"log4",[Numerator_Measure4])

     

    Create a measure. The measure uses the function to determine which value is currently hovering, and then returns the corresponding molecule.

    a = 
    
    VAR _Dynamic_Numerator = 
    SWITCH(SELECTEDVALUE('Table'[log]),"log1",[Numerator_Measure1],"log2",[Numerator_Measure2],"log3",[Numerator_Measure3],"log4",[Numerator_Measure4])
    
    return _Dynamic_Numerator
    

     

    This is my Tooltips, which is stored in it:

     

    The results of the return of Tooltips and the name of the measure must be based on your own.

     

    Click the strip diagram visual object.

     

    In the "Visualizations" pane, the "General" >> "Tooltips" part is unfolded.

     

    Select your own custom Tooltips in Page.

     

    Hang the mouse on each log in the bar diagram to ensure that the correct molecule is displayed in the tool prompt.

     

    Part of the demonstration results are as shown below:

     

    You hope to display your new weight below the "Actual QTy -CE" line. The method of implementing this is that you customize a Tooltips and drag and drop the content you want to show to the page.

     

    The following is the link of the official Power BI document, which may help:

    Create report tooltip pages in Power BI - Power BI | Microsoft Learn

    SWITCH function (DAX) - DAX | Microsoft Learn

    SELECTEDVALUE function - DAX | Microsoft Learn


    If you need to help or the problem still exist, please contact again at any time.

     

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

2 Replies

  • Tooltips are tied to the data point, not necessarily the measure.

     

    Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

    Do not include sensitive information or anything not related to the issue or question.

    If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

    Please show the expected outcome based on the sample data you provided.

    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Hope everything is going well.

     

    The following is a step -by -step guide for creating a dynamic attitude value for Tooltips:

     

    Create a measure for each molecule:

    Numerator_Measure1 = SUM('SalesLT SalesOrderDetail'[UnitPrice])
    Numerator_Measure2 = SUM('SalesLT Product'[StandardCost])

     

    First, make sure that each computing molecule has a separate measure.

     

    Create a new table "Table" and associate the 4 degree value with the value in the table. Different Measure is displayed according to different values in the table.

    Measure = SWITCH(SELECTEDVALUE('Table'[log]),"log1",[Numerator_Measure1],"log2",[Numerator_Measure2],"log3",[Numerator_Measure3],"log4",[Numerator_Measure4])

     

    Create a measure. The measure uses the function to determine which value is currently hovering, and then returns the corresponding molecule.

    a = 
    
    VAR _Dynamic_Numerator = 
    SWITCH(SELECTEDVALUE('Table'[log]),"log1",[Numerator_Measure1],"log2",[Numerator_Measure2],"log3",[Numerator_Measure3],"log4",[Numerator_Measure4])
    
    return _Dynamic_Numerator
    

     

    This is my Tooltips, which is stored in it:

     

    The results of the return of Tooltips and the name of the measure must be based on your own.

     

    Click the strip diagram visual object.

     

    In the "Visualizations" pane, the "General" >> "Tooltips" part is unfolded.

     

    Select your own custom Tooltips in Page.

     

    Hang the mouse on each log in the bar diagram to ensure that the correct molecule is displayed in the tool prompt.

     

    Part of the demonstration results are as shown below:

     

    You hope to display your new weight below the "Actual QTy -CE" line. The method of implementing this is that you customize a Tooltips and drag and drop the content you want to show to the page.

     

    The following is the link of the official Power BI document, which may help:

    Create report tooltip pages in Power BI - Power BI | Microsoft Learn

    SWITCH function (DAX) - DAX | Microsoft Learn

    SELECTEDVALUE function - DAX | Microsoft Learn


    If you need to help or the problem still exist, please contact again at any time.

     

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!