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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
FruitBat
Frequent Visitor

Lookup and List.Distinct, List.Sort within same table

In my content management system, I can make a relationship between table rows (and their respective IDs).

 

The original or "base" table is Table 1, and it contains all rows.

 

I've replicated that table and renamed it Table 2.  Table 2 has distinct "Child_IDs" from Table 1.

 

The two tables - Table 1, and Table 2 - are then related using a one-to-many relationship on "ID" (Table 1) and "Child_ID" (Table 2).  See the attached PBIX.

 

Here's Table 1.

 

IDPOSTED_DATEDOC_NOTRANS_NOVENDOR_NOFISCAL_YR
120210518N45067112199VN000012332019
120210518N45067112199VN000012332020
220210518JV43667225300 2021
320210518R538024467400          2007
420210518 500VN000125442017
520210518 600VN000157492021

 

And Table 2.

 

IDChild_ID
12
13
41
44
45

 

The result I need is a table of columns that distinctly list, in ascending fashion, related dimensions from other IDs.  Generally, I prefer to do this in M Query, but I suspect it can be optimized in DAX, as well.

 

For example...

 

IDPOSTED_DATEDOC_NOTRANS_NOVENDOR_NOFISCAL_YR  FISCAL_YR_CHILD
120210518N45067112199VN000012332019, 20202007, 2021

 

Any ideas?

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

1. PBIX file is not attached.

2. I have a follow up question. Will it have a cascading impact through relationship. For example, 4 is related to 1 which is in turn related to 2 & 3. Hence, will the output of 4 contain elements from 2 & 3 as well. 

Hello, Vijay.  Great questions. 

 

No - there's no expectation for cascading relationships (or any expectatation that they be queried, for that matter).

 

Apologies - seems I can't upload the sample PBIX.  

 

For context, I've tried to merge and append tables to create a unified solution, but without much luck; and I've attempted a few LOOKUPs and SELECTEDVALUE measures, but no luck there, either.  Nor with CONTAINS, but I believe that only returns True(), rather than values (?).

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.