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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Johnn
Frequent Visitor

new customers based off transaction history

Hi,

 

I'm trying to figure out how to idenitfy new merchants based off transaction data. I have a transaction table that has merchant info included. The firstdate function looks like it has worked when I create a table of merchant ID and first transaction date. But I'm not sure how to sum the new merchant IDs per month and show this in a visualization.

 

I'm a new user to power bi so I'm not sure if I'm missing something obvious here.

 

Thanks for any help,

Johnn

1 ACCEPTED SOLUTION
vanessafvg
Community Champion
Community Champion

@Johnn

 

taken from  http://www.daxpatterns.com/new-and-returning-customers/  (you will need a datetable for this)

here is an example he provides

 

[New Customers] :=
COUNTROWS (
    FILTER (
        ADDCOLUMNS (
            VALUES ( Sales[CustomerKey] ),
            "PreviousSales", CALCULATE (
                COUNTROWS ( Sales ),
                FILTER (
                    ALL ( 'Date' ),
                    'Date'[FullDate] < MIN ( 'Date'[FullDate] )
                )
            )
        ),
        [PreviousSales] = 0
    )
)




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
fhill
Resident Rockstar
Resident Rockstar

Please post some sample or mock data, so we can better understand your table / data structure.  Thank You - FOrrest




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




Johnn
Frequent Visitor

 

Hi,

 

This is a sample of what my data looks like:

 

timetest.PNG

 

I just want to say that I had 2 new merchants in Jan 2016 (A and B), 1 new merchant in Feb 2016 (C), and 2 new merchants in March 2016 (E and D). The firstdate function correctly gives what I want but not sure how to count the new merchants to display by month.

 

Capturetest2.PNG

 

Thanks for any help.

 

 

 

vanessafvg
Community Champion
Community Champion

@Johnn

 

taken from  http://www.daxpatterns.com/new-and-returning-customers/  (you will need a datetable for this)

here is an example he provides

 

[New Customers] :=
COUNTROWS (
    FILTER (
        ADDCOLUMNS (
            VALUES ( Sales[CustomerKey] ),
            "PreviousSales", CALCULATE (
                COUNTROWS ( Sales ),
                FILTER (
                    ALL ( 'Date' ),
                    'Date'[FullDate] < MIN ( 'Date'[FullDate] )
                )
            )
        ),
        [PreviousSales] = 0
    )
)




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Thanks that worked great! Also it seems to have worked fine without any datetable (i just used the date in my transaction table).

vanessafvg
Community Champion
Community Champion

@Johnn excellent just be mindful that it could cause issues but if it isn't great its just best practise.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.