Forum Discussion

TeamCanada26__'s avatar
TeamCanada26__
Frequent Visitor
3 years ago
Solved

How can I count on a multiple text filter

I am trying to count the number of "Other" leaves.

 

This returns 0, as we can't count on a multiple filter, any ideas as to how to resolve in a measure?

 

Count of Other LWOP =
CALCULATE(
    COUNTA('Demographic'[Leave Type]),
    'Demographic'[Leave Type] IN {
        "Family Related and Personal Leave without Pay > Care and Nurturing LWOP",
        "Family Related and Personal Leave without Pay > Maternity LWOP",
        "Family Related and Personal Leave without Pay > Maternity LWOP",
        "Family Related and Personal Leave without Pay > Parental LWOP",
        "Family Related and Personal Leave without Pay > Parental LWOP",
        "Family Related and Personal Leave without Pay > Relocation of Spouse LWOP",
        "Leave without Pay > Sick LWOP",
        "Other Leave without Pay > Educational LWOP",
        "Other Leave without Pay > Long-Term Disability LWOP",
        "Other Leave without Pay > Other LWOP",
        "Other Leave without Pay > Self Funded LWOP",
        "Other Leave without Pay > Suspension/Disciplinary Action LWOP",
        "Other Leave without Pay > Union Business LWOP"
    }
)
  • TeamCanada26__ Perhaps try:

    Measure = 
      VAR __Table = FILTER('Demographic',[Leave Type] IN {
            "Family Related and Personal Leave without Pay > Care and Nurturing LWOP",
            "Family Related and Personal Leave without Pay > Maternity LWOP",
            "Family Related and Personal Leave without Pay > Maternity LWOP",
            "Family Related and Personal Leave without Pay > Parental LWOP",
            "Family Related and Personal Leave without Pay > Parental LWOP",
            "Family Related and Personal Leave without Pay > Relocation of Spouse LWOP",
            "Leave without Pay > Sick LWOP",
            "Other Leave without Pay > Educational LWOP",
            "Other Leave without Pay > Long-Term Disability LWOP",
            "Other Leave without Pay > Other LWOP",
            "Other Leave without Pay > Self Funded LWOP",
            "Other Leave without Pay > Suspension/Disciplinary Action LWOP",
            "Other Leave without Pay > Union Business LWOP"
          }
      )
    RETURN
      COUNTAX(__Table,[Leave Type])

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    TeamCanada26__ Perhaps try:

    Measure = 
      VAR __Table = FILTER('Demographic',[Leave Type] IN {
            "Family Related and Personal Leave without Pay > Care and Nurturing LWOP",
            "Family Related and Personal Leave without Pay > Maternity LWOP",
            "Family Related and Personal Leave without Pay > Maternity LWOP",
            "Family Related and Personal Leave without Pay > Parental LWOP",
            "Family Related and Personal Leave without Pay > Parental LWOP",
            "Family Related and Personal Leave without Pay > Relocation of Spouse LWOP",
            "Leave without Pay > Sick LWOP",
            "Other Leave without Pay > Educational LWOP",
            "Other Leave without Pay > Long-Term Disability LWOP",
            "Other Leave without Pay > Other LWOP",
            "Other Leave without Pay > Self Funded LWOP",
            "Other Leave without Pay > Suspension/Disciplinary Action LWOP",
            "Other Leave without Pay > Union Business LWOP"
          }
      )
    RETURN
      COUNTAX(__Table,[Leave Type])