Reply
powerbiexpert22
Post Prodigy
Post Prodigy

new customers

i need to find customers who never placed order before given date

 

example vishal is new customers on date 10-06-2002 

 

powerbiexpert22_0-1710636929762.png

 

 

 

 

powerbiexpert22_2-1710636973693.png

powerbiexpert22_3-1710637009034.png

 

 

 

 

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
v-zhengdxu-msft
Community Support
Community Support

Hi @powerbiexpert22 

 

Thanks for the reply from @Jihwan_Kim , please allow me to provide another insight:

I create a set of sample data, and add a calculate column on order table:

 

customername = RELATED(customer[name]) 

 

vzhengdxumsft_0-1710915874385.png vzhengdxumsft_3-1710916010000.png

Then add a calender table:

 

Table = CALENDARAUTO()

 

vzhengdxumsft_2-1710915927346.png

Then create a measure:

 

MEASURE =
VAR _getdate =
    MAX ( 'Table'[Date] )
VAR _getname =
    FILTER (
        SUMMARIZE (
            ADDCOLUMNS (
                'order',
                "_mindate",
                    CALCULATE (
                        MIN ( 'order'[orderdate] ),
                        FILTER (
                            ALL ( 'order' ),
                            'order'[customerid] = EARLIER ( 'order'[customerid] )
                        )
                    )
            ),
            [customername],
            [_mindate]
        ),
        [_mindate] >= _getdate
    )
RETURN
    CONCATENATEX ( _getname, [customername], "; " )

 

Then add a slicer:

vzhengdxumsft_4-1710916093651.png

And a card:

vzhengdxumsft_5-1710916116924.png

You can select the date from the slicer, and the outcome is the customername who never placed order before the selected date, the result is as follow:

vzhengdxumsft_6-1710916322176.png

 

Best Regards

Zhengdong Xu
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
Raj341
Frequent Visitor

Hi @powerbiexpert22 
CC: @Jihwan_Kim @v-zhengdxu-msft 
I have the same issue, is your issue resolved?
I am trying to fix the similar issue.
Data looks almost similar to your excel. I created the bins like 0-2, 2-4 etc, through dax. now I need to insert the values of customers count. but i am always getting aggregate value. if your issue is resolved please help me to fix it
Measure1:

Customer_count=
VAR _MinDate = Table[Min_Order_Date]
VAR _MaxDate = Table[Max_Order_Date]

RETURN
CALCULATE(
DISTINCTCOUNT(Table[OrderNo]),
Table[OrderDate] >= _MinDate && Table[OrderDate] <= _MaxDate,
ALLEXCEPT(Table, Table[CustomerID])

Column1: 
Customer_Order_Bucket =
SWITCH(
TRUE(),
[Customer_count] = 1, "1",
[Customer_count] >= 2 && [Customer_count] <= 4, "2-4",
[Customer_count] >= 5 && [Customer_count] <= 6, "5-8",
[Customer_count] >= 9, "9+",
"Other"
But still I am getting the results like below

Raj341_0-1716970430883.png

Please help me where i am doing wrong

v-zhengdxu-msft
Community Support
Community Support

Hi @powerbiexpert22 

 

Thanks for the reply from @Jihwan_Kim , please allow me to provide another insight:

I create a set of sample data, and add a calculate column on order table:

 

customername = RELATED(customer[name]) 

 

vzhengdxumsft_0-1710915874385.png vzhengdxumsft_3-1710916010000.png

Then add a calender table:

 

Table = CALENDARAUTO()

 

vzhengdxumsft_2-1710915927346.png

Then create a measure:

 

MEASURE =
VAR _getdate =
    MAX ( 'Table'[Date] )
VAR _getname =
    FILTER (
        SUMMARIZE (
            ADDCOLUMNS (
                'order',
                "_mindate",
                    CALCULATE (
                        MIN ( 'order'[orderdate] ),
                        FILTER (
                            ALL ( 'order' ),
                            'order'[customerid] = EARLIER ( 'order'[customerid] )
                        )
                    )
            ),
            [customername],
            [_mindate]
        ),
        [_mindate] >= _getdate
    )
RETURN
    CONCATENATEX ( _getname, [customername], "; " )

 

Then add a slicer:

vzhengdxumsft_4-1710916093651.png

And a card:

vzhengdxumsft_5-1710916116924.png

You can select the date from the slicer, and the outcome is the customername who never placed order before the selected date, the result is as follow:

vzhengdxumsft_6-1710916322176.png

 

Best Regards

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

Jihwan_Kim
Super User
Super User

Hi,

I do not know how your expected outcome looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_1-1710656377352.png

 

 

Jihwan_Kim_0-1710656353944.png

 

 

no order customers before the period: = 
COUNTROWS (
    FILTER ( VALUES ( customer[customer_id] ), ISBLANK ( [Sales by order date:] ) )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)