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
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/
v-jayw-msft
Community Support
Community Support

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

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

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

Hi @orana ,

 

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

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
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
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.