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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
mraka9
Helper III
Helper III

Selection of related items

greeting,

apologies in my poor English language.

I need to make a filter that will link related items.

 

yellow, green and blue are labeled related items according to case, group and item.

Stock Number C0762202 is related to artifacts SL695, the article SL695 is related to PP782 and KHT25.

 

example:

I want to get all the related items when I choose the arctic C0762202

 

thanks in advance

 

 

Upit.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@mraka9,

Firstly, split column in Query editor as below.
Capture.PNG

Secondly, create the following columns in the table.

Column = CALCULATE( COUNTA(Table1[Stock Number]),ALLEXCEPT(Table1,Table1[Stock Number]))
Checkcolumn = CALCULATE(FIRSTNONBLANK(Table1[Stock Number],Table1[Stock Number]),FILTER(Table1,Table1[Case]=EARLIER(Table1[Case])&&Table1[Group]=EARLIER(Table1[Group])&&Table1[Item]=EARLIER(Table1[Item])&&Table1[Column]=2))


Thidly, create a new table using dax below.

Table = DISTINCT(Table1[Stock Number])


At last, create the following measures in original table, drag the chk measure to visual level filter and set its value to 1. You can review attached PBIX file to get more details.

mergedvalue = CALCULATE(CONCATENATEX(VALUES(Table1[Stock Number]),Table1[Stock Number],"/"),ALLEXCEPT(Table1,Table1[Checkcolumn]))
chk = var searchval=SELECTEDVALUE('Table'[Stock Number],"") return IF(ISERROR(SEARCH(searchval,[mergedvalue])),0,1)

1.PNG

Regards,
Lydia

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@mraka9,

Firstly, split column in Query editor as below.
Capture.PNG

Secondly, create the following columns in the table.

Column = CALCULATE( COUNTA(Table1[Stock Number]),ALLEXCEPT(Table1,Table1[Stock Number]))
Checkcolumn = CALCULATE(FIRSTNONBLANK(Table1[Stock Number],Table1[Stock Number]),FILTER(Table1,Table1[Case]=EARLIER(Table1[Case])&&Table1[Group]=EARLIER(Table1[Group])&&Table1[Item]=EARLIER(Table1[Item])&&Table1[Column]=2))


Thidly, create a new table using dax below.

Table = DISTINCT(Table1[Stock Number])


At last, create the following measures in original table, drag the chk measure to visual level filter and set its value to 1. You can review attached PBIX file to get more details.

mergedvalue = CALCULATE(CONCATENATEX(VALUES(Table1[Stock Number]),Table1[Stock Number],"/"),ALLEXCEPT(Table1,Table1[Checkcolumn]))
chk = var searchval=SELECTEDVALUE('Table'[Stock Number],"") return IF(ISERROR(SEARCH(searchval,[mergedvalue])),0,1)

1.PNG

Regards,
Lydia

Lydia you're genius

 

 

1.png2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I have a question

when i choose PP79, appears rttt15 (0007/2018-00, 99, 2) 

but when I choose rttt15, it just came out PP79 (0007/2018-00, 99, 2) and it does not appear PP79 (0050/2018-00, 1, 1)

 

the problem is that my base is very large and it takes a lot of time to get the result 😞

 

but every honor. a genial idea

 

thank you

 

 

Greg_Deckler
Community Champion
Community Champion

I believe you could create a measure like:

 

Measure = 
VAR __stockNumber = MAX('Table2'[Stock Number]) //gets currently filtered stock number
RETURN
IF(__stockNumber IN 'Table1'[Stock Number],1,0)

You could then create a table visual with Table1 columns and filter it by Measure = 1



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks to Greg_Deckler, unfortunately I can not make the instructions 😞

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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