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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Salva_BI_DAX
Regular Visitor

Show row based on slicer value

Hi everyone,

 

I am still bit new here, and I woul like your help on this.

 

I have a table like this:

IDName
1A
1AA
1AAA
2B
2BB
2BBB
3C
3CC

 

I have a filter that show all Names, if I select AA I need to see this

IDName
1A
1AA
1AAA

 

and if I select C I need to see this

IDName
1A
1AA
1AAA

 

I tried to create a flag like this but it does not work

_slicer =

CALCULATE (
DISTINCTCOUNT ( tmp[id] ),
FILTER (
ALL ( tmp ),
tmp[id] = SELECTEDVALUE(tmp[id])
)
)
 
Thanks,
Salva

 

Best,

Salvatore 

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

Hi , @Salva_BI_DAX 

According to your description, you want to have a [Name] filter and when you select a name, and show all the same id and the names. RIght?

Here are the steps you can refer to :

(1)My test data is the same as yours.

(2)We need to click "New Table" to create a table :

Slicer = VALUES('Table'[Name])

(3)We need to create a measure :

Measure = var _slicer = VALUES(Slicer[Name])
var _t =DISTINCT( SELECTCOLUMNS(FILTER(ALLSELECTED('Table'), 'Table'[Name] in _slicer),"ID",[ID]))
var _current_id = SELECTEDVALUE('Table'[ID])
return
IF(_current_id in _t ,1,0)

(4)Then we can put the 'Slicer'[Name] on the slicer visual and the field we need on the table visual , and configue the measure on the "Filter on this visual":

vyueyunzhmsft_0-1668735328798.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

Hi , @Salva_BI_DAX 

According to your description, you want to have a [Name] filter and when you select a name, and show all the same id and the names. RIght?

Here are the steps you can refer to :

(1)My test data is the same as yours.

(2)We need to click "New Table" to create a table :

Slicer = VALUES('Table'[Name])

(3)We need to create a measure :

Measure = var _slicer = VALUES(Slicer[Name])
var _t =DISTINCT( SELECTCOLUMNS(FILTER(ALLSELECTED('Table'), 'Table'[Name] in _slicer),"ID",[ID]))
var _current_id = SELECTEDVALUE('Table'[ID])
return
IF(_current_id in _t ,1,0)

(4)Then we can put the 'Slicer'[Name] on the slicer visual and the field we need on the table visual , and configue the measure on the "Filter on this visual":

vyueyunzhmsft_0-1668735328798.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

I did a test and it worked just fine.
Thank you 🙂

daXtreme
Solution Sage
Solution Sage

I think it would be highly advisable that before you post a question you check it for mistakes and logical inconsistencies...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 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.