Forum Discussion
Force Directed Graph with Retrospective
- 4 years ago
HI Anonymous ,
Create a table with all the airports then add the following measure:
Filter Airports = IF ( VALUES ( 'Table'[Destination] ) IN VALUES ( Airport[Airport] ) || VALUES ( 'Table'[Source] ) IN VALUES ( Airport[Airport] ), 1 )Now use this measure to filter out the Force direct and the Airport has your slicer:
Check PBIX file attach.
Hi Anonymous ,
To what I can you want to show the routes correct?
Try the following add the measure below:
Total Flights = COUNTROWS(filter(ADDCOLUMNS('Table', "FilterAirports", [Filter Airports]), [FilterAirports] <> BLANK()))
Now use this measure on the tree map visualization and the destinations / source on the explanation:
Thanks Miguel. Almost close. But the below is what im trying to get. Any thoughts. I'm not trying to count the flights.
Please dont get carried away by the word "Destination". The intent of the tree is show only connections between airports and what flights. Atlanta connects 4 airports. So when atlanta is selected, tree's first column should only be 4 airports. Next tree column is flights.
- MFelix4 years agoSuper User
Hi Anonymous ,
Since you want to different interactions and with a single slicer you need to make a second table for the airports and the add the following measure:
Filter Decomposition = VAR temp_table = FILTER ( ADDCOLUMNS ( 'Table', "FilterAir", [Filter Airports] ), [FilterAir] <> BLANK () ) VAR airportsselection = UNION ( FILTER ( SELECTCOLUMNS ( temp_table, "Airport", 'Table'[Source] ), NOT ( [Airport] IN VALUES ( 'Airport - Slicer'[Airport] ) ) ), FILTER ( SELECTCOLUMNS ( temp_table, "Airport", 'Table'[Destination] ), NOT ( [Airport] IN VALUES ( 'Airport - Slicer'[Airport] ) ) ) ) RETURN COUNTROWS ( FILTER ( 'Airport - Decomposition Tree', 'Airport - Decomposition Tree'[Airport] IN airportsselection ) )Now use the column on the second airport table to be you column on the decompostion tree and filter the decompositon by the previous measures: