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] ) ) ) ) )
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.
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 )