Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hellor
I need some help with this problem: I have many users and each one has made, at least, one purchase at some point, I need to know the date of the first purchase they have made to count the amount of first purchaces made in a month.
OG table
User | purchase_date |
A | 2023-02-01 |
A | 2023-02-14 |
A | 2023-03-29 |
B | 2023-02-10 |
C | 2022-12-23 |
C | 2023-07-04 |
C | 2023-09-15 |
First purchase table
user | "first_purchase" |
A | 2023-02-01 |
B | 2023-02-10 |
C | 2022-12-23 |
Probably this is not the best way to do this, if someone can guide me to something I can study to achieve this goal is very appreciated.
Solved! Go to Solution.
You can produce your required output by the following table dax formula.
In this simple data model, I separately created a calendar table (dimension table) and created a one to many relationship with the fact table because it is the best practice to do so.
I omit detailed explanations here, but instead, please find attached the link to the pbix file, and please let me know if anything is unclear.
You can produce your required output by the following table dax formula.
In this simple data model, I separately created a calendar table (dimension table) and created a one to many relationship with the fact table because it is the best practice to do so.
I omit detailed explanations here, but instead, please find attached the link to the pbix file, and please let me know if anything is unclear.
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |