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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
orana
Helper I
Helper I

Show only initial customer purchase

Hello,

 

I currently have a bar chart that shows the number of customers who made purchases over a year. The y-axis shows the months and the x-axis shows a count of customer. A customer could have made >1 purchases per month and/or >1 purchase per year. 

 

I would like to have a bar chart to only show a customer's initial purchase.  For example if customer A purchased twice in October - once on October 2nd & another time on Oct 15th and 3 times in November (3, 15, 25). The bar chart will only show customer A purchase on October 2nd. 

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Create a Calendar Table with a relationship from the Date column of the Purchase date table to the Date column of the Calendar Table.  In the Calendar Table, write calculated column formulas to extract Year, Month name and Month number.  Sort the Month name column by the month number column.  Via slicers, select Year and Month name.  To your matrix visual, drag Customer Name and drag this measure

Measure 1 = min(Data[Purchase date])

Does this help?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @orana ,

 

You could create a measure as below.

Measure = 
var first_date = CALCULATE(MIN('Table'[date]),ALLEXCEPT('Table','Table'[customer]))
return
IF(SELECTEDVALUE('Table'[date])=first_date,SELECTEDVALUE('Table'[purchase]),BLANK())

1.PNG

 

Best Regards,

Jay

Looking at my data, the dates seem to all be the first of each month so for the example provided - "a" would have the date 9/1/21, 9/1/21, 10/1/21. Is there a way to get around this?

Hey,

 

It doesn't seem to be working. To help, I created a power bi example and shared the accompany excel file in the hopes that this will help. If you look at Sheet 2, you'll see that in Sept and November the customer "my" appears in both months. Ideally, i would only want "my" to show up when "my" made the its first purchase. This would be in Sept. 

 

Power BI example Accompanying Excel file 


Best,

Oscar

Anonymous
Not applicable

Hi @orana ,

 

Using the above formula will get two records of 9/1/2021 for "a". What is the expected result?

 

Best Regards,

Jay

orana
Helper I
Helper I

This changes entire data set around and impacts my abiilty to use this information in other charts. Is there another way?

@orana 

you can also try to create a new table

Table 2 = SUMMARIZE('Table','Table'[customer],"date",min('Table'[date]))




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@orana 

maybe you can try group by the table to get the min date

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors