Forum Discussion
Finding paths connected through a node. Data filtering
- 3 years ago
Try
Connected Mains = VAR InitialNodes = UNION( VALUES( 'Table'[Str1] ), VALUES( 'Table'[Str2] ) ) VAR ConnectedMains = CALCULATETABLE( VALUES( 'Table'[Main] ), 'Table'[Str1] IN InitialNodes || 'Table'[Str2] IN InitialNodes, REMOVEFILTERS( 'Table' ) ) VAR ConnectedMainsExlcudingCurrent = EXCEPT( ConnectedMains, { SELECTEDVALUE( 'Table'[Main] ) } ) VAR Result = CONCATENATEX( ConnectedMainsExlcudingCurrent, 'Table'[Main], ", " ) RETURN Result - 3 years ago
If I understand correctly you want a list of mains and all the nodes they are connected to. You could do another table like
Main All Connected = GENERATE ( ALLNOBLANKROW ( 'Main Neighbours'[Radialnr-rettet] ), DISTINCT ( UNION ( CALCULATETABLE ( VALUES ( 'Main Neighbours'[Connected To] ) ), CALCULATETABLE ( VALUES ( 'Main Neighbours'[Neighbours Neighbour] ) ) ) ) )
Hi johnt75
I have a followup issue, which I cannot seem to solve.
The above solution you provided gives me the "Neighbors" of the Main, however when I want the Neighbors-Neighbor, I just put the Main in a new table or matrix and get the Neighbors-Neighbor. This is viable but not practical.
However, in this method I will have to make 3 tables just to show these information, and I only have the choice to click on Neighbors-Neighbor which filters the picture, yet I have no choice in having Neighbor table to show me the picture.
Is there a way to collate them all into 1 view or 1 table/matrix and each Main is separately clickable.
I have a picture you can see what I mean.
Is the filter collider a good idea to see the Neighbors-neighbor?
however at the moment it shows the previous chosen Main:
No idea if this will work but these are my thoughts, for what they're worth.
You could try creating a field parameter which includes columns from Main, Main's neighbour and Neighbour's neighbour. Put the field parameter on each of the slicers, and set a filter on the field parameter in each slicer, so each one shows a different column.
On the chart, also use the field parameter as the value. I'm hoping that when you select one of the values from the slicer that selection, along with the field parameter filter, will get applied to the chart and show the correct info.
- Asina3 years agoHelper III
Thanks for answering, however I am not sure I fully get what you mean.. Do you have an example?
Also is there a way to fix the following where the Mains Neighbor shows a comma between the Main, since it is not filterable. I know some nodes might have many connections to other Mains, but is there a way to show only 1 Neighbor per row, but make the row duplicate itself if more than 1 connection is spotted as to avoid the comma issue? See picture below.
- johnt753 years agoSuper User
There's no way to solve the issue of multiple entries using a measure. You could instead create a calculated table containing all the mains and all the connected entities, I think the below should work
Main Neighbours = GENERATE ( ALLNOBLANKROW ( 'Table'[Main] ), VAR InitialNodes = UNION ( CALCULATETABLE ( VALUES ( 'Table'[Str1] ) ), CALCULATETABLE ( VALUES ( 'Table'[Str2] ) ) ) VAR ConnectedMains = CALCULATETABLE ( VALUES ( 'Table'[Main] ), 'Table'[Str1] IN InitialNodes || 'Table'[Str2] IN InitialNodes, REMOVEFILTERS ( 'Table' ) ) VAR ConnectedMainsExlcudingCurrent = EXCEPT ( ConnectedMains, { 'Table'[Main] } ) RETURN ConnectedMainsExlcudingCurrent )- Asina3 years agoHelper III
I created a new table in DAX and put the above code, however I receive:
The end of the input was reached