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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

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
Most Valuable Professional
Most Valuable Professional

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.