Forum Discussion

Tinus1905's avatar
Tinus1905
Resolver I
2 years ago
Solved

PowerBi filter multiple columns with multiple filters

Hi,   Im struggling a little bit with an measure.  I have the following table.  ID       Status           Type          Name 123 accept yes yellow 123 accept yes   456 not possib...
  • Tinus1905's avatar
    2 years ago

    This formula must be it.

     

    Count =
    CALCULATE(
    DISTINCTCOUNT(tableA[ID]),

    (tableA[Type] = "yes" || tableA[Type] = "no") ||
    (tableA[Status] = "not possible" &&
    tableA[Name] = "green"))

     

    The only question I have now is, ID 456 is double and with distinctcount I get 1 count. But will it count the row with column "name" and "green" value or the other one. So is distinccount after the filters has been set or is it before the filters. 

  • Uzi2019's avatar
    2 years ago

    Hi Tinus1905 
    try below measure.

     

    Count of id =
    CALCULATE(DISTINCTCOUNT('Table'[ID]),AND('Table'[Status]="not possible" , 'Table'[Name]="green") || 'Table'[Type]="yes"|| 'Table'[Type]= "no")
     

     

     

    I hope I answered your question!