The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi everyone,
I am still bit new here, and I woul like your help on this.
I have a table like this:
ID | Name |
1 | A |
1 | AA |
1 | AAA |
2 | B |
2 | BB |
2 | BBB |
3 | C |
3 | CC |
I have a filter that show all Names, if I select AA I need to see this
ID | Name |
1 | A |
1 | AA |
1 | AAA |
and if I select C I need to see this
ID | Name |
1 | A |
1 | AA |
1 | AAA |
I tried to create a flag like this but it does not work
Best,
Salvatore
Solved! Go to Solution.
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":
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
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":
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 🙂
I think it would be highly advisable that before you post a question you check it for mistakes and logical inconsistencies...
User | Count |
---|---|
24 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |