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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
vnqt
Helper V
Helper V

Filter a column based on another column result in same table

Hi,

I look around but didn't find any solution for this case, hope someone can help. 

I have 2 tables

Table A

EquipementParentCode
GSC0B107428107501
GSC0V107428107500
GSC7S107503107504
GSCA3107508107506
GSCAE107499107498
GSCBD107509105921
GSCC6107511107510
GSCFV107502107503
GSCIP107505107508
GSCJ5107507107499
GSCJW107428107509
GSCL2107428107511
GSCNZ107501107502
GSCSF107501107505
GSCZG107501107507
GSCZY107428107497
GSC1T107427340979
GSC7T107501107516
GSCAH107500107522
GSCBG107504107520
GSCCD107506107523
GSCEQ107498107524
GSCGX105921107517
GSCHI107510107526
GSCJN107427107515
GSCM9107427107514
GSCNF107427107513
GSCRU107427107512
GSCV0107519107521
GSCVV107525107519
GSCXV107518107525
GSCZT107427107518

 

Table B 

 

Equipement
GSC0B
GSC0V
GSC7S
GSCA3
GSCAE
GSCBD
GSCC6
GSCFV
GSCIP
GSCJ5
GSCJW
GSCL2
GSCNZ
GSCSF
GSCZG
GSCZY
GSC1T
GSC7T
GSCAH
GSCBG
GSCCD
GSCEQ

 

There is a slicer with the name of Equipment (Table B) 

When a Equipment selected, here for example:  Equipment:  GSC0B in table A, the code is 107501, then I use this code to search in column Parent, the result is below : 

Nom_EquipementParentCode_Barre
GSCNZ107501107502
GSCSF107501107505
GSCZG107501107507
GSC7T107501107516

 

Could you please advise how I could filter the table as above ? 

Thank you in advance for any suggestion. 

Tg

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @vnqt ,

 

Please try to apply this measure to the table visual's filter:

Flag = 
var _a = ALLSELECTED('Table B'[Equipement])
var _b = SELECTCOLUMNS(FILTER(ALL('Table A'),[Equipement] in _a),"Code",[Code])
return IF(SELECTEDVALUE('Table A'[Parent]) in _b,1)

vjianbolimsft_0-1684895309182.png

Final output:

vjianbolimsft_1-1684895340381.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-jianboli-msft
Community Support
Community Support

Hi @vnqt ,

 

Please try to apply this measure to the table visual's filter:

Flag = 
var _a = ALLSELECTED('Table B'[Equipement])
var _b = SELECTCOLUMNS(FILTER(ALL('Table A'),[Equipement] in _a),"Code",[Code])
return IF(SELECTEDVALUE('Table A'[Parent]) in _b,1)

vjianbolimsft_0-1684895309182.png

Final output:

vjianbolimsft_1-1684895340381.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-jianboli-msft for the solution, It works perfectly if I don't have any relation between 2 tables. 

For some other views , I need a relation between 2 tables as below : 

vnqt_1-1685000112093.png

Could you please advise if it's possible to resolve this without removing the relation ? 

 

Many thanks in advance.

Tg

Hi @vnqt ,

 

If you have relationship between these two tables, the slicer Equipement will filter the table visual directly.

Maybe you need to create a new table for the slicer.

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you !

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.