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.
Hello,
I have been trying to create a Parent / Child hierarchy with part numbers which I have managed to work out through posts.
This has been created using Dax using Path & Pathlength commands.
I can filter out what I need if I type the part number (see below) in the Dax code and this looks up the "Path" field and (Table 2) gives me my results.
What I would like is to click on (Table 1) and the selected row would be in the Dax code to filter the results in (Table 2).
I can not for the life of me figure out how to get this to work, can anybody help.
Solved! Go to Solution.
Hi @Rae2023 ,
Thanks for @danextian reply.
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:
Create a new table with the root Child ID column.
Child ID = VALUES('Table'[Child ID])Child ID = VALUES('Table'[Child ID])
Create two measures
Measure =
IF(
SELECTEDVALUE('Table'[Parent ID]) = BLANK(),
IF(
SELECTEDVALUE('Table'[Child ID]) = SELECTEDVALUE('Child ID'[Child ID]),
1,
0
),
IF(
SELECTEDVALUE('Table'[Parent ID]) = SELECTEDVALUE('Child ID'[Child ID]) || SELECTEDVALUE('Table'[Child ID]) = SELECTEDVALUE('Child ID'[Child ID]),
1,
0
)
)
Contains = IF([Measure] = 1,".","No Records")
Use measure as the filter on this visual and set show the item is 1
Use Child ID [Child ID] as the value of slicer
Final output
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Rae2023 ,
Thanks for @danextian reply.
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:
Create a new table with the root Child ID column.
Child ID = VALUES('Table'[Child ID])Child ID = VALUES('Table'[Child ID])
Create two measures
Measure =
IF(
SELECTEDVALUE('Table'[Parent ID]) = BLANK(),
IF(
SELECTEDVALUE('Table'[Child ID]) = SELECTEDVALUE('Child ID'[Child ID]),
1,
0
),
IF(
SELECTEDVALUE('Table'[Parent ID]) = SELECTEDVALUE('Child ID'[Child ID]) || SELECTEDVALUE('Table'[Child ID]) = SELECTEDVALUE('Child ID'[Child ID]),
1,
0
)
)
Contains = IF([Measure] = 1,".","No Records")
Use measure as the filter on this visual and set show the item is 1
Use Child ID [Child ID] as the value of slicer
Final output
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you so much,
This has had me scratching my head all weekend.
Once again, thank you.
Hi @Rae2023 ,
It seems like a case wildcard lookup. The attached PBIX might help.
Thank you danextian,
As I'm relatively new to Power BI / DAX, I still can't get this to work.
I've created a .pbix file but can't seem to find the paperclick to attach the example.
Is there a way to select a number in (Table 1) and pass this to the DAX measure, instead of typing in the number in DAX.
The filter in DAX filters correctly and the results are in (Table 2).
Thanks again.