Forum Discussion

Juju-PowerBI's avatar
Juju-PowerBI
Frequent Visitor
5 years ago
Solved

Filter count

 

Bonjour

 

Je souhaiterais untiliser une mesure, avec la fonction COUNT, mais selon un filtre, compter les books pour lesquelles la valeur est supérieur à 4

 

Comment faire ?

 

Merci

  • Juju-PowerBI 

    You're right:

    Measure V2 =
    COUNTROWS (
        CALCULATETABLE (
            Table1,
            TREATAS (
                FILTER ( DISTINCT ( Table1[Book] ), CALCULATE ( COUNT ( Table1[Book] ) ) >= 4 ),
                Table1[Book]
            )
        )
    )
    

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

     

7 Replies

  • AlB's avatar
    AlB
    Community Champion

    Juju-PowerBI 

    It looks like we're running in circles. For that you just need what I already offered as first solution, on a card visual. So I am repeating myself here:

    Measure =
    COUNTROWS (
        FILTER ( DISTINCT ( Table1[Book] ), CALCULATE ( COUNT ( Table1[Book] ) ) >=  4 )
    )

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

    • Juju-PowerBI's avatar
      Juju-PowerBI
      Frequent Visitor

      Merci AlB 

       

      Cependant la formule marche bien, mais je souhaiterais avoir le total en valeur qui est de 8

       

  • AlB's avatar
    AlB
    Community Champion

    Hi Juju-PowerBI 

    It would help if you showed the actual expected result.

    Try this in a card visual

    Measure =
    COUNTROWS (
        FILTER ( DISTINCT ( Table1[Book] ), CALCULATE ( COUNT ( Table1[Book] ) ) > 4 )
    )

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

     

    • Juju-PowerBI's avatar
      Juju-PowerBI
      Frequent Visitor

      Bonjour AlB 

       

      Il semble que mes références peuvent etre différentes, comme ci dessous

       

      Je suis à la recherche d'une mesure me permettant comter les Books celon un filtre

       

       

      Quand pensez vous ? merci

    • Juju-PowerBI's avatar
      Juju-PowerBI
      Frequent Visitor

      Bonjour AlB 

       

      J'ai essayé cette solution, mais je souhaiterais l'incorporer dans une mesure pour pouvoir comparer au total

       

      Peut être que cet exemple serait mieux

       

      Merci

  • AlB's avatar
    AlB
    Community Champion

    Juju-PowerBI 

    1. Place Book in a table visual

    2. Place this measure in the table visual

    Measure = COUNT ( Table1[Book] )

    3. Use [Measure]  as a filter for the table visual, choosing to show when value is >= 4

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

     

  • AlB's avatar
    AlB
    Community Champion

    Juju-PowerBI 

    You're right:

    Measure V2 =
    COUNTROWS (
        CALCULATETABLE (
            Table1,
            TREATAS (
                FILTER ( DISTINCT ( Table1[Book] ), CALCULATE ( COUNT ( Table1[Book] ) ) >= 4 ),
                Table1[Book]
            )
        )
    )
    

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers