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
mamunabdullah
Frequent Visitor

Customer Distinct Count with Multiple Conditions

Hi Experts,

Need your help to calculate distinct count of my customers by "Customer code" where SalesQty sum of basepack code "6A43B3A48TV170301" & "6A43B3A48TV170303" is equal or greater than 8. Condition is none of the basepack code alone should be less than 1. 

Download the excel data: https://we.tl/t-RsXKbpVttv

 

mamunabdullah_0-1663089466426.png

 



TIA

4 REPLIES 4
v-chenwuz-msft
Community Support
Community Support

Hi @mamunabdullah ,

 

Try this measure:

 

=
COUNTROWS (
    FILTER (
        'CustomerSales',
        OR (
            [Basepack Code] = "6A43B3A48TV170301",
            [Basepack Code] = "6A43B3A48TV170303"
        )
    )
)

 

And put it in the filter pane of this table visual then set it show items which is equal or greater than 8

vchenwuzmsft_0-1663143743019.png

 

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

Hi @v-chenwuz-msft, maybe I couldn't make you understand my requirement. I need to check how many customers have purchased more than or equal 8 units of combined basepack "6A43B3A48TV170301" & "6A43B3A48TV170303". But each of the basepack purchase must not be less than 1. 

mamunabdullah
Frequent Visitor

Hi @ERD, I saw you solved similar problem! Can you pls help me out with this one?

 

Hello @mamunabdullah ,

Don't know if you still need some help, but you can try this measure:

 

YourMeasure = 
VAR t_with_b_code =
    CALCULATETABLE (
        CustomerSales,
        CustomerSales[Basepack Code] IN { "6A43B3A48TV170301", "6A43B3A48TV170303" }
    )
VAR rows_amt = COUNTROWS ( t_with_b_code )
RETURN
    SUMX ( FILTER ( t_with_b_code, rows_amt = 2 ), [SalesQty] )

 

ERD_0-1666781250336.png

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

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