Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Juju-PowerBI
Frequent Visitor

Filter count

Capture.PNG

 

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

1 ACCEPTED SOLUTION
AlB
Super User
Super User

@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 

 

SU18_powerbi_badge

 

View solution in original post

7 REPLIES 7
AlB
Super User
Super User

@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 

 

SU18_powerbi_badge

 

AlB
Super User
Super User

@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 

 

SU18_powerbi_badge

Merci @AlB 

 

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

 

89.PNG

AlB
Super User
Super User

@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 

 

SU18_powerbi_badge

 

AlB
Super User
Super User

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 

 

SU18_powerbi_badge

 

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

 

gg2.PNG

Merci

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

 

capture gg.PNG

 

Quand pensez vous ? merci

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors