Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Percentage with slicer

Hello, I am trying to get percentage but if i change the slicer min or max values the percentage doesn't work accurately. 

Formula I am using is Grid Percentage = COUNTROWS('Grid Info')/CALCULATE(COUNTROWS('Grid Info'), REMOVEFILTERS('Grid Info'[Grid Pass/Fail])) 

Below on first snapshot you can see it is showing correct percentage but if I change the pops slicer min or max value, it doesn't work properly, as pops are changing too with grid pass/fail. Need to know how I can make it fixed for fail/pass but keeping all other filter values while calculating the percenatge.

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous 

    Please try to use ALL() function

    e.g 

    Grid Percentage = COUNTROWS('Grid Info')/COUNTROWS(ALL('Grid Info'))

     

    Best Regards!

    Yolo Zhu

     

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Any help on this please?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    You can use "Edit interaction" to set pop slicers not affected  by "Grid slicer".

    Click the "Grid slicer" then select "Edit interactions"

     

    Then choose the pop slicers and select "None" icon, the slicers will not affected by the Grid slicer.

    You can refer to the following link.

    Change how visuals interact in a report - Power BI | Microsoft Learn

     

    Best Regards!

    Yolo Zhu

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

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      I am using that to display the percentage on the card, I can't select none for that. and I actally don't want to have the slicer filter get disconnected with the rest. I want the count to be what it was before the grid pass/fail  selected  filter but when I try to use remove filter formula on measure it will still count the rows of that filterd pops. Kindly let me know what can I do.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous 

        You can try the following code, 

         

        Grid Percentage = COUNTROWS('Grid Info')/COUNTROWS(ALLEXCEPT('Grid Info'[Total Pops]))

         

         

        Best Regards!

        Yolo Zhu

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