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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
samihuq
Helper III
Helper III

Find Earliest Transaction Date of a User

Edited..

 

Hi,

We have two tables, User_Table and Transaction_Table User_Table. We need to populate the earliest transaction date of a user to understand after how many days did a user made their first transaction after they were ceated. Note, there are users who did not make any transactions.

 

Transaction Table looks as bellow:

 

UserID Date Amount

01730311476 01 jan 2018 10

01730311476 05 jan 2018 20

01730311476 7 jan 2018 10

01730311476 13 jan 2018 10

01612123456 03 jan 2018 10

01612123456 09 jan 2018 10

01612123456 11 jan 2018 10

 

User Table looks as bellow with desired result in the Date column:

 

User_ID-Name-User_Creation_Date-First_Transaction_Date

01730311476-Sami-01_Dec_2018-?

01612123456-Rumana-01_Dec_2018 ?

01512789654-Tanim-01_Jan_2018 ?

 

How can we attain this?

 

Thanks,

Sami

1 ACCEPTED SOLUTION

Got the solution by ourselves 😄

 

First Payment Date = CALCULATE(FIRSTDATE(Payment[Transaction Date].[Date]),FILTER(Payment,User[Mobile]=Payment[Mobile]))

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

 

Create a relationship from the UserID column of the Transaction table to the UserID column of the User Table.  In your visual, drag the User_ID and Name from the User Table and write this measure

 

First date=MIN('Transaction'[Date])

 

Hope this helps.


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

Hi,

We can not create relationship between dates as both table has multiple dates. Note we already have relationship between the users.

 

 

Zubair_Muhammad
Community Champion
Community Champion

If the 2 tables are related, you could use

=calculate (min(transactions table[date]))

As calculated colum

Hi, solution did not work 😞

Mine works and i have tested it.


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

Hey Ashish,

Thanks man for the answer, actually i it was mmy mistake, i could not potray the right picture. Here is it again:

 

We have two tables, User_Table and Transaction_Table.

 

Transaction Table looks as bellow:

 

UserID_Transaction_Date_Amount

01730311476 01 jan 2018 10

01730311476 05 jan 2018 20

01730311476 7 jan 2018 10

01730311476 13 jan 2018 10

01612123456 03 jan 2018 10

01612123456 09 jan 2018 10

01612123456 11 jan 2018 10

 

User Table looks as bellow with desired result in the Date column:

 

User_ID-Name-User_Creation_Date-First_Transaction_Date

01730311476-Sami-01_Dec_2018-?

01612123456-Rumana-01_Dec_2018 ?

01512789654-Tanim-01_Jan_2018 ?

 

Now, we need to fetch the earliest transaction date for a user to understand after how many days did a user made their first transaction after they were ceated. Note, there are users who did not make any transactions as well.

 

Will your solution still work?

 

 

Hi,

 

Yes, my solution will still work.  Please re-read my reply in which i i shared the solution.


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

Hi,

I already had the relationship and now when i have inserted the formula, i am receiving Dec 6 2017, for all the users which happens to be the very first transaction date which is not true, since different user has different forst date, more importantly, majority of user should not have any transaction date. Am i missing anything?

 

I am sending the screenshots of teh tables and relationship. Here User ID will be the "Mobile" column.

 

Transaction 3.pngTransaction 2.pngTransaction 1.png

Got the solution by oursleves 😄

 

First Payment Date = CALCULATE(FIRSTDATE(Payment[Transaction Date].[Date]),FILTER(Payment,User[Mobile]=Payment[Mobile]))

 

Cheers,

Sami

Got the solution by ourselves 😄

 

First Payment Date = CALCULATE(FIRSTDATE(Payment[Transaction Date].[Date]),FILTER(Payment,User[Mobile]=Payment[Mobile]))

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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