filterpowerbidashboard

how to count rows of a correspondent value?


some values in the CODE column share the same value in ZONE column. when users select a code from a slicer built with CODE column, in a table it should return the total count of the ZONE value of this code.

enter image description here In this table, when users select 1001, users need to see the count of AA, which is 3. If 1003 is selected, the result should also be 3. On the Dashboard, CODE is the only slicer for users.

Thank you in advance!

  1. I used MAX to find the corresponding ZONE value.
  2. The result is always either 2 or 1, I don't know how to remove the first level filter - Selected Code.

Solution

  • Try using ALL or REMOVEFILTERS to clear the slicer context. For example:

    Zone Count = 
      CALCULATE(
        COUNTROWS(YourTable),
        FILTER(
          ALL(YourTable),
          YourTable[Zone] IN DISTINCT(YourTable[Zone])
        )
      )
    

    Giving you a result like:
    enter image description here