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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Sofinobi
Helper IV
Helper IV

Number of customers commandes > 2 in a week

hi community,

please if you can help, i want to calculate the number of customers that have more than 2 commandes in a week
that i can display in a matrice by Région as in the Pbix file attached

 thank you
Nbr_Commande 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Sofinobi ,

 

I suggest you to try this code as below to create a measure.

Count Customer = 
VAR _SUMMAIRZE =
    SUMMARIZE (
        ALLEXCEPT ( Tableau1, Tableau1[Date] ),
        Tableau1[Région],
        Tableau1[Customer],
        "nbr commande", [nbr commande]
    )
RETURN
    COUNTAX (
        FILTER (
            _SUMMAIRZE,
            [Région] = MAX ( Tableau1[Région] )
                && [nbr commande] > 2
        ),
        [Customer]
    )

Due to your sample only have last week data, so I change the date filter to show last week value.

vrzhoumsft_0-1682931277554.png

Also in your sample only have customers whose commandes >=2, I change the filter to show values [nbr commande]>=2 to have a test. Result is as below.

vrzhoumsft_1-1682931378344.png

 

Best Regards,

Rico Zhou

 

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

View solution in original post

3 REPLIES 3
Sofinobi
Helper IV
Helper IV

🤔

Anonymous
Not applicable

Hi @Sofinobi ,

 

I suggest you to try this code as below to create a measure.

Count Customer = 
VAR _SUMMAIRZE =
    SUMMARIZE (
        ALLEXCEPT ( Tableau1, Tableau1[Date] ),
        Tableau1[Région],
        Tableau1[Customer],
        "nbr commande", [nbr commande]
    )
RETURN
    COUNTAX (
        FILTER (
            _SUMMAIRZE,
            [Région] = MAX ( Tableau1[Région] )
                && [nbr commande] > 2
        ),
        [Customer]
    )

Due to your sample only have last week data, so I change the date filter to show last week value.

vrzhoumsft_0-1682931277554.png

Also in your sample only have customers whose commandes >=2, I change the filter to show values [nbr commande]>=2 to have a test. Result is as below.

vrzhoumsft_1-1682931378344.png

 

Best Regards,

Rico Zhou

 

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

thank you so much for you answer , that works
and sorry to be late, cause i was in an other project;

thank you again

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.