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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Racquel
New Member

Text contains from a different table and returning the latest field

Hi,

My aim is to produce a visual that will show customer payment days (ie how long it took them to pay the full invoice)

I have 2 tables. Invoices and Payments.

The invoices have a unique audit number.

The payments have an allocation column which may contain multiple invoice audit numbers.

The payments allocation column may also have one invoice audit number against multiple payments (if there has been part payments). 

Payments:

Racquel_0-1680136651027.png

Invoices:

Racquel_3-1680137502035.png

 

Formula:

let InvAuditNo=[AutoIdx]
in

Text.Combine(
Table.SelectRows(CustomerPayments,
each Text.Contains(InvAuditNo,[cAllocs]))
[TxDate]
,
",")

 

As you can see, I am trying to bring in the TxDate from the payments table into the invoices table.

The PaymentDate column gives me an error - is this because there may be multiple payment dates or the column I am brinbging in is a date?

 

How can I change this formula to bring in the last date that was allocated to the invoice and no date if there has been no payment yet?

 

Kind regards

R

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

let InvAuditNo=[AutoIdx]
in

List.Max(
Table.SelectRows(CustomerPayments,
each Text.Contains([cAllocs],InvAuditNo))
[TxDate]
)

View solution in original post

2 REPLIES 2
Racquel
New Member

Perfect, Thank you SO much 🙂

wdx223_Daniel
Super User
Super User

let InvAuditNo=[AutoIdx]
in

List.Max(
Table.SelectRows(CustomerPayments,
each Text.Contains([cAllocs],InvAuditNo))
[TxDate]
)

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors