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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Schwurblini
Frequent Visitor

If value is true return first entry found from another table

Dear Community

 

I have an issue with a query and i could need some help:

 

I have a table (Table A) with merchants that have registered on a specific date. These merchants have a unique ID and a Creation date.

Now i have a second table (Table B) where i track the transactions of these Merchants with the unique ID.

 

I need a query where i can compare the date when they were created and when they did their first transaction. I would imagine in  something like a new column in Table A which checks in Table B if the Unique ID is there and then returns the first "Date" entry it found)

 

Table A:

Schwurblini_0-1696928769796.png

Table B:

Schwurblini_0-1696928392835.png

As you can see in Table B "978193" is in there twice because he did a transaction in week 1 and 2. Now i would need to know, fro Table A when he was created and when he did his first transaction.

 

If he was created and never did any transaction, the return value would be "No transactions done"

 

Can yo help me with that?

 

Thank you so much and best regards

   

 

1 ACCEPTED SOLUTION
mickey64
Super User
Super User

For your reference.

 

Step 0: I use these data tables.

Table A:

Topnode Number VP Create date
955758 08/01/2021
960651 21/01/2021
962197 26/01/2021
963128 27/01/2021
964017 30/01/2021
964497 02/02/2021
964743 02/02/2021
965216 03/02/2021
965605 04/02/2021
969300 15/02/2021
969578 16/02/2021
970595 18/02/2021
978193 23/03/2021
980164 07/05/2021
1143077 12/08/2021
1111255 30/09/2021
1129074 13/10/2021

 

Table B:

Month Week All Topnodes
1.2022 1.2022 970595
1.2022 1.2002 978193
1.2022 2.2002 978193
1.2022 2.2002 980164
1.2022 2.2002 1143077
1.2022 3.2022 978193
1.2022 3.2022 1111255
1.2022 3.2022 1129074
1.2022 4.2002 970595
1.2022 4.2002 978193
1.2022 4.2002 980164

 

Step 1: I add a relationship.

mickey64_0-1696934175649.png

Step 2: I make a measure.

    Min Week = MIN('Table B'[Week])

 

Step 3: I make a matrix.

mickey64_1-1696934285809.png

 

 

 

View solution in original post

2 REPLIES 2
mickey64
Super User
Super User

For your reference.

 

Step 0: I use these data tables.

Table A:

Topnode Number VP Create date
955758 08/01/2021
960651 21/01/2021
962197 26/01/2021
963128 27/01/2021
964017 30/01/2021
964497 02/02/2021
964743 02/02/2021
965216 03/02/2021
965605 04/02/2021
969300 15/02/2021
969578 16/02/2021
970595 18/02/2021
978193 23/03/2021
980164 07/05/2021
1143077 12/08/2021
1111255 30/09/2021
1129074 13/10/2021

 

Table B:

Month Week All Topnodes
1.2022 1.2022 970595
1.2022 1.2002 978193
1.2022 2.2002 978193
1.2022 2.2002 980164
1.2022 2.2002 1143077
1.2022 3.2022 978193
1.2022 3.2022 1111255
1.2022 3.2022 1129074
1.2022 4.2002 970595
1.2022 4.2002 978193
1.2022 4.2002 980164

 

Step 1: I add a relationship.

mickey64_0-1696934175649.png

Step 2: I make a measure.

    Min Week = MIN('Table B'[Week])

 

Step 3: I make a matrix.

mickey64_1-1696934285809.png

 

 

 

Thats great, i forgot to mention that i already had a relationship, so i couldnt connect them this way but i circumvented this with a "SUMMARIZE" Table and linked it like you mentioned. Worked like a charm

 

Best of thanks 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.