Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Count Text Measure

Hi I have a measure that will let me know if someone is expected to make a target

 

Expected to Make Target = IF([Hours needed per Month]<=[MTD Expected Hours]+40, "Yes", "No")
 
However, I don't seem to be able to be able to put it in a pie chart or on a card to see the number of people that is "Yes" or "No". 
 
Any suggestions.  The Format is Text. 
  • Dhairya's avatar
    Dhairya
    3 years ago

    Hey Anonymous 

    Create the following two measure

     

    Count of No = CALCULATE(COUNT(SQL[Expected to Make Target]), SQL[Expected to Make Target] = "No")
     
    Count of Yes = CALCULATE(COUNT(SQL[Expected to Make Target]), SQL[Expected to Make Target] = "Yes")

    and use them to plot cards and pie charts, you will get following result

    If this helps you, please mark my solution as accepted so that others can find this quickly when they face a similar issue. Thank you!

10 Replies

  • Dhairya's avatar
    Dhairya
    Icon for Solution Supplier rankSolution Supplier

    Hey Anonymous 
    One workaround is that create a Calculated column instead of measure with the same Dax code and plot it in the value field of the pie chart.

    If this helps you, please mark my solution as accepted so that others can find this quickly when they face a similar issue. Thank you!

    • Anonymous's avatar
      Anonymous
      Not applicable

      I want to see a number like a the Number of No expected not to make target, but when I put in card view it does not give me an option to count.  Intstead it just shows No

      I tried putting in count display name and then filtering it by No but I get 3,932, however there should only be 3 

       

      I've tried a use the measure = 

      CALCULATE(COUNTROWS(SQL), FILTER(SQL,[Expected to Make Target]= "No")), however that gave me 44, however it should be 3. 
      • Dhairya's avatar
        Dhairya
        Icon for Solution Supplier rankSolution Supplier

        Hey Anonymous 

        Create the following two measure

         

        Count of No = CALCULATE(COUNT(SQL[Expected to Make Target]), SQL[Expected to Make Target] = "No")
         
        Count of Yes = CALCULATE(COUNT(SQL[Expected to Make Target]), SQL[Expected to Make Target] = "Yes")

        and use them to plot cards and pie charts, you will get following result

        If this helps you, please mark my solution as accepted so that others can find this quickly when they face a similar issue. Thank you!

  • pls try this

    CALCULATE(COUNTROWS(SQL), 
             FILTER(
                 ALL(SQL)
                   ,[Expected to Make Target]= "No"))