Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

DISTINCTCOUNT with multiple Filters

Hello, I am trying to get the count of a column where the column value is equal to something. I have the below formula which works with 1 filter:

Windows =
CALCULATE(
DISTINCTCOUNT( 'enterprise-attack'[Value.x_mitre_platforms] ),
FILTER('enterprise-attack',[Value.x_mitre_platforms]="Windows")
)

 

 

However, i want to filter on 3 options, i have tried the following but it doesnt appear to be working

Windows =
CALCULATE(
DISTINCTCOUNT( 'enterprise-attack'[Value.x_mitre_platforms] ),
FILTER(
'enterprise-attack',[Value.x_mitre_platforms]="Windows",
'enterprise-attack',[Value.x_mitre_platforms]="Linux",
'enterprise-attack',[Value.x_mitre_platforms]="macOS"
)
)
 
How can i get it to do the above count?
  • Anonymous , Try a measure like

     

    CALCULATE(
    DISTINCTCOUNT( 'enterprise-attack'[Value.x_mitre_platforms] ),
    FILTER(
    'enterprise-attack',[Value.x_mitre_platforms] in {"Windows","Linux","macOS"}
    )
    )

3 Replies

  • Anonymous , Try a measure like

     

    CALCULATE(
    DISTINCTCOUNT( 'enterprise-attack'[Value.x_mitre_platforms] ),
    FILTER(
    'enterprise-attack',[Value.x_mitre_platforms] in {"Windows","Linux","macOS"}
    )
    )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello, thanks for that it doesnt appear to error anymore :). However, i only get an answer of 1 when ideally it should be 3?

      • Anonymous's avatar
        Anonymous
        Not applicable

        ignore. Appears to be now working. Thank you