Filter slice to find record based on values in another table

HCF
New Member

I try to filter records in slice from table Contacts based on values in table Activities with this expression,
In(
Contacts[UniqueID] ,
OrderBy( Select( Activities[Contacts], True ), [LastSelect] )
)
, but it will not let me do that. Please let me know what I am doing wrong?
3X_1_c_1c3e9e54937560b77e1d6e74824c5351cf86ea17.png

Solved Solved
0 6 1,150
1 ACCEPTED SOLUTION

So first recommendation is just make a MAX_Activities slice with a formula similar to this
[CurrentTimeStamp]

=
MAX(
SELECT(
CurrentInvoice[CurrentTimeStamp],
[UserEmail]=USEREMAIL()
)
)

I donโ€™t know how youโ€™re Activities table is set up exactly but basically this slice is to filter down to the row you want just to make it easier to user in many places. From there you would just do IN([UniqueID],ANY(SELECT(MAX_ACTIVITIES[CONTACTS],true))

Slice filters are performed row by row so you donโ€™t need Contacts[UniqueID]. I assume [Contacts] is a list column correct?

(what the heck happened to my text I was just trying to format the code and this happened)

View solution in original post

6 REPLIES 6

Steve
Platinum 4
Platinum 4

What are you trying to accomplish, specifically?

ORDERBY() sorts a list of rows; it does not filter them.

Select( Activities[Contacts], True ) can be written simply as Activities[Contacts].

In what table is the LastSelect column?

@Steve - I am trying to get the latest record selected (I have an action to set the value of the selected record of the Activities table) - โ€œLastSelectedโ€ type DateTime.
Then, I want to filter records in the Contacts table where the UniqueID is in list Activities[Contacts] through a filter on the slice of Contacts.
Hope that makes sense.

So you want the [contacts] of the last selected record in the Activities table? And then filter the contacts table on whether they are in that [contacts]?

@Austin_Lambeth - yes, thatโ€™s right.

So first recommendation is just make a MAX_Activities slice with a formula similar to this
[CurrentTimeStamp]

=
MAX(
SELECT(
CurrentInvoice[CurrentTimeStamp],
[UserEmail]=USEREMAIL()
)
)

I donโ€™t know how youโ€™re Activities table is set up exactly but basically this slice is to filter down to the row you want just to make it easier to user in many places. From there you would just do IN([UniqueID],ANY(SELECT(MAX_ACTIVITIES[CONTACTS],true))

Slice filters are performed row by row so you donโ€™t need Contacts[UniqueID]. I assume [Contacts] is a list column correct?

(what the heck happened to my text I was just trying to format the code and this happened)

@Austin_Lambeth - perfect!!
Thanks for helping - that did the tricks.

Top Labels in this Space