cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter a datatable on excact match based on datacard value

Hi,

I need some help to filter a datatable based on a value in a datacard. It seems like my formulae includes records which consist of some of the value in the Datacard. So both 14 and 4 is shoing tn the datatable. I need an exact match. This is the formulae I have used: 

Sort(Filter(CC_Comments, CC_ID in DataCardValue144.Text),Date,Descending)

MatchID.jpg

 

Thanks,

Trond

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User III
Super User III

@Anonymous 

Suggest you use the equals operator instead like this.

Sort(Filter(CC_Comments, CC_ID = DataCardValue144.Text),Date,Descending)

 

The IN operator checks if any of the characters found in DataCardValue144.Text are in CC_ID.  Essentially it is the same as saying is my CC_ID in the list of numbers [1,4].  That's why the datatable returns the wrong result.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

2 REPLIES 2
mdevaney
Super User III
Super User III

@Anonymous 

Suggest you use the equals operator instead like this.

Sort(Filter(CC_Comments, CC_ID = DataCardValue144.Text),Date,Descending)

 

The IN operator checks if any of the characters found in DataCardValue144.Text are in CC_ID.  Essentially it is the same as saying is my CC_ID in the list of numbers [1,4].  That's why the datatable returns the wrong result.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

Anonymous
Not applicable

Thanks @mdevaney  for your quick reply 🙂

This worked perfectly (and something I should have thought of 🙈)

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,654)