Forum Discussion

hoosha_11's avatar
hoosha_11
Helper I
2 years ago
Solved

Custom Pass/Fail Thresholds in Power BI Table Visuals

Hi,

 

We have a table visual with a 'Score' column. If the score is greater than 80, it's considered a 'Pass' with a green background; if it's less than 80, it's marked as 'Fail' with a red background. But, users should be able to set their own pass/fail % limit. For example, if someone sets the limit to 60%, then any score below 60% should display in red. Is there a way to achieve this in Power BI?

 

Thanks!

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi parry2k ,thanks for the quick reply, I'll add further.

    Hi hoosha_11 ,

    I noticed that your connection mode is Live connection, maybe you can use the conditional format.

    The Table data is shown below:

    Please follow these steps:
    1. Use the following DAX expression to create a measure(The user can just change the score in the expression)

     

    Measure = IF(SELECTEDVALUE('Table'[Score]) >= 80 ,"Pass","Fail")

     

     2.Use the following DAX expression to create a measure

     

    Measure 2 = IF([Measure] = "Fail","RED","GREEN")

     

    3.Setting the Conditional Format

    4.Final output

    Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

     

     

    Best Regards,
    Wenbin Zhou
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

    • hoosha_11's avatar
      hoosha_11
      Helper I

      Thanks a lot! I just checked and since there is a live connection to the semantic model for each report, the what-if parameter is grayed out. Are there any workarounds to use this option?

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi parry2k ,thanks for the quick reply, I'll add further.

    Hi hoosha_11 ,

    I noticed that your connection mode is Live connection, maybe you can use the conditional format.

    The Table data is shown below:

    Please follow these steps:
    1. Use the following DAX expression to create a measure(The user can just change the score in the expression)

     

    Measure = IF(SELECTEDVALUE('Table'[Score]) >= 80 ,"Pass","Fail")

     

     2.Use the following DAX expression to create a measure

     

    Measure 2 = IF([Measure] = "Fail","RED","GREEN")

     

    3.Setting the Conditional Format

    4.Final output

    Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

     

     

    Best Regards,
    Wenbin Zhou
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.