Forum Discussion

chestercas's avatar
chestercas
Helper I
3 years ago

Distinct Count with true/false

Hi,

 

I have a table with custumer and a percent value.
I want to calculate the number of custumer who is under 50%.

My goal is to create a card graph, with this total. I tried many measure (countrows, countX...) But nothing is ok.

That mesure return me a empty value, or total value no filtered.

My measure:

VAR bour = CALCULATE(DISTINCTCOUNT(DATA_BRMC[Nom prénom CC]),FILTER(DATA_BRMC,_txfac>0.5)
 
Thank you for your help !

4 Replies

  • mlsx4's avatar
    mlsx4
    Memorable Member

    Have you tried with:

     

    bour= 
    COUNTROWS(
      SUMMARIZE(
        FILTER(DATA_BRMC,_txfac>0.5),
        DATA_BRMC[Nom prénom CC]
      )
    • chestercas's avatar
      chestercas
      Helper I

      Hi,

      Thanks for your help ! it doesn't work. I have empty result to. 😞

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  chestercas ,

     

    Card Visual is equivalent to the Total row in the table, when the Total row is blank, Card Visual will also show blank, you can try the Sumx() function

    You can create a Measure

    Flag =
    SUMX('DATA_BRMC',[VAR bour])

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • chestercas's avatar
      chestercas
      Helper I

      Thank you ! It doesn't work too...
      I created 2 measures :

      Bour test = CALCULATE(DISTINCTCOUNT(DATA_BRMC[Nom prénom CC]),FILTER(DATA_BRMC,_txFAC<0.5)
      Nb dépo FAC = SUMX(DATA_BRMC,[bour test])


      As you say, card takes blank rows...
      So I show my 2 measures on a table. [BOUR] detect correctly txfac>0.5. But [nb dépo FAC] no... And also, it count all rows >0.5 in my table. I just want a "1" value on my select period... 😞


      Thanks for your help and your time ! 🙂