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
Sjon_1791
Regular Visitor

count new customers that bought something

All,

I have this dax formula from QQUBE. But it is counting all new customers, but i want to see the ammount of customers that bought something.

If i add a visual filter, it keeps the same number of customers. 

How do i add a filter (sales values [sales values, line sales order orginal amount])

Count of New Customers = 
    COUNTROWS (
        FILTER (
            CALCULATETABLE (
                ADDCOLUMNS (
                    VALUES ( 'SALES VALUES'[LinkToCustomerID] ),
                    "DateOfFirstBuy", CALCULATE ( MIN ( 'SALES VALUES'[Related Date] ) )
                ),
                ALL ( 'SALES VALUES' )
            ),
            CONTAINS (
                VALUES ( 'SALES VALUES'[Related Date] ), 
                'SALES VALUES'[Related Date], 
    
                [DateOfFirstBuy] 
            )
        ))

 

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Sjon_1791 ,

 

You may try ALLSELECTED instead of ALL.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

It is giving a error

PB new customer.JPG

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.