Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Force Directed Graph with Retrospective

Hi there,

 

In a force directed graph, I'm looking to see all interactions related to a node when a slicer is used. 

 

In the below you could see once Atlanta is selected, it shows only ATL - BOS but not BOS - ATL.  Is there a way to show all interaction to that node? apologize i could not attach the pbix however i have provide the details below. 

 

AJAJ_0-1646670335053.png

 

 

DummyData

SourceDestinationFlight
AtlantaBostonFlight1
AtlantaChicagoFlight2
AtlantaNewYorkFlight3
BostonAtlantaFlight4

 

Thanks

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

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:

MFelix_0-1646823225840.png

Check PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Thanks Miguel. It works. I have few more scenario.

How do i attach a pbix?

 

MFelix
Super User
Super User

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:

MFelix_0-1646823225840.png

Check PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Thanks Miguel. Apologize i cant attach since my org does not allow online drives. So trying my best on the image below. On the same report i have another visual. (i cant use filter airport to the visual. may be its a visual issue?)

 

Changes made

- Added a new record (phoenix to atlanta record)

- Added phoenix to airport table

- Added State to airport table

- Added Decomposition tree

 

AJAJ_0-1646845834593.png

 

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:

 

MFelix_0-1646850302585.png

 

MFelix_1-1646850315873.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

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.

 

AJAJ_0-1646855821300.png

 

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:

MFelix_0-1646914637667.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.