Forum Discussion
Child and parent filter
My requirement is I have Main table that is below and Imported into Power BI made table visual and taken Child field as a slicer and when choose any Child filed please see My requirement
Main table
| Child | Parent |
| AAA | 1 |
| BBB | 1 |
| CCC | 1 |
| AAA | 2 |
| DDD | 2 |
| FFF | 2 |
| BBB | 3 |
| CCC | 3 |
| DDD | 3 |
| FFF | 3 |
| AAA | 4 |
| FFF | 4 |
| GGG | 4 |
| SSS | 4 |
My requirement
If i select AAA then display like
| Child | Parent |
| AAA | 1 |
| BBB | 1 |
| CCC | 1 |
| AAA | 2 |
| DDD | 2 |
| FFF | 2 |
| AAA | 4 |
| FFF | 4 |
| GGG | 4 |
| SSS | 4 |
Please help me on this
thank you in advance
Anonymous
You can achieve this by creating a separate disconnected table for the Child column.You can download the file: HERE
Measure = var __childselected = SELECTEDVALUE('Child Table'[Child]) var __table = CALCULATETABLE( 'Main Table', 'Main Table'[Child] = __childselected ) return ISEMPTY(__table) * 1________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
6 Replies
- Fowmy
Super User
Anonymous
You can achieve this by creating a separate disconnected table for the Child column.You can download the file: HERE
Measure = var __childselected = SELECTEDVALUE('Child Table'[Child]) var __table = CALCULATETABLE( 'Main Table', 'Main Table'[Child] = __childselected ) return ISEMPTY(__table) * 1________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
- AnonymousNot applicable
Working great Thank you Fowmy
- KristaFrequent Visitor
Fowmy -- I've run into this same issue and I think your solution will work, but I can't access the file you linked to. I've created the separate table and measure, but I'm not sure where to go from there. Which table is the measure supposed to be created in? From which table do I use the Child field for the slicer?
Thanks!!
- AntrikshSharma
Community Champion
Anonymous I am not being rude, but you haven't even written a single full sentence, how would someone understand what you are trying to achieve? 🙂
- AnonymousNot applicable
- AnonymousNot applicable
When I select CCC
Child Parent AAA 1 BBB 1 CCC 1 BBB 3 CCC 3 DDD 3 FFF 3