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
TheBigFrench
Regular Visitor

Visualize links between data

Hi,

How can visualize the link between data, in a single table.

Here is a very simple example  :

COL1COL2
AXX
BXX
CXX
AYY
EYY
FXX
FYY
HYY
IXX
JYY
MYY
MYY
MXX
NXX

 

In this exemple, the cells in bold and green are common between YY and XX.

What type of visualise (or calculation two), can I use to only see the value in common ?

I tries to used the "forced directed graph" (from Microsoft), but I don't know how to filter value in common only (so the graph is unreadable).

The value are not that, but my table is realy like that, with millions of lines, but with only few in common, I want to visualize.

Thanks for your help and advices

1 ACCEPTED SOLUTION
Daniel29195
Super User
Super User

@TheBigFrench 

Daniel29195_1-1706300897729.png

 

the one on the right,  when you selected from slicer, xx  and yy , it will filter out and leave only the values that have xx and yy in comon . 

Measure 10 =
var filters = countrows(ALLSELECTED(table31[COL2]))
var datasource =
filter(
ADDCOLUMNS(
    SUMMARIZE(
        table31,
        table31[COL1]
    ),
    "@x" ,  CALCULATE(DISTINCTCOUNT(table31[COL2]))
),
[@x] = filters
)

RETURN
    CALCULATE(
        COUNTROWS(table31),
        KEEPFILTERS(datasource)
    )

 

 

## -############

## -############

## -############

 

the one on the left , will show which values have common data from the other column .  ( not affected by slicer) (this is somewhat complex ) 

Measure 9 =
var datasource =
ADDCOLUMNS(
    ALLSELECTED(table31[COL1]),
    "@concat"  ,
    CALCULATE(
        CONCATENATEX(
            WINDOW(
                0,
                ABS,
                -1,
                ABS,
                SUMMARIZE(
                    table31,
                    table31[COL1],
                    table31[COL2])
                    ,ORDERBY(table31[COL2] ,  asc )
            ),
            table31[COL2], ","
        )
    )
)

var selected_current_filter_context =  SELECTEDVALUE(table31[COL1])

var current_row_data =
SELECTCOLUMNS(
FILTER(
    datasource,
    table31[COL1] = selected_current_filter_context
),
[@concat]
)

var result =
FILTER(
    datasource,
    [@concat] = current_row_data
)

RETURN CONCATENATEX(result, table31[COL1] , ", " )
 

 

 

 

 

 

If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. I would appreciate hitting that kudos button 👍🤠

 

 




View solution in original post

4 REPLIES 4
Daniel29195
Super User
Super User

@TheBigFrench 

Daniel29195_1-1706300897729.png

 

the one on the right,  when you selected from slicer, xx  and yy , it will filter out and leave only the values that have xx and yy in comon . 

Measure 10 =
var filters = countrows(ALLSELECTED(table31[COL2]))
var datasource =
filter(
ADDCOLUMNS(
    SUMMARIZE(
        table31,
        table31[COL1]
    ),
    "@x" ,  CALCULATE(DISTINCTCOUNT(table31[COL2]))
),
[@x] = filters
)

RETURN
    CALCULATE(
        COUNTROWS(table31),
        KEEPFILTERS(datasource)
    )

 

 

## -############

## -############

## -############

 

the one on the left , will show which values have common data from the other column .  ( not affected by slicer) (this is somewhat complex ) 

Measure 9 =
var datasource =
ADDCOLUMNS(
    ALLSELECTED(table31[COL1]),
    "@concat"  ,
    CALCULATE(
        CONCATENATEX(
            WINDOW(
                0,
                ABS,
                -1,
                ABS,
                SUMMARIZE(
                    table31,
                    table31[COL1],
                    table31[COL2])
                    ,ORDERBY(table31[COL2] ,  asc )
            ),
            table31[COL2], ","
        )
    )
)

var selected_current_filter_context =  SELECTEDVALUE(table31[COL1])

var current_row_data =
SELECTCOLUMNS(
FILTER(
    datasource,
    table31[COL1] = selected_current_filter_context
),
[@concat]
)

var result =
FILTER(
    datasource,
    [@concat] = current_row_data
)

RETURN CONCATENATEX(result, table31[COL1] , ", " )
 

 

 

 

 

 

If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. I would appreciate hitting that kudos button 👍🤠

 

 




TheBigFrench
Regular Visitor

I tried creating a table (with two formulas : , with the agregation and the count (STEP 3 above), but on STEP 4, it is always filtered by the row context : 

NewTable = DISTINCT('OrigineTable'[col1]
And 
Totals =
   SUMX(
      VALUES('OrigineTable'[col1]),
      CALCULATE(COUNT('OrigineTable'[col2]))
   )
 
But when I use the Totals in NEWTable linked with OrigineTable (on col1), it won't work, because of the row context !
TheBigFrench
Regular Visitor

Hi @Greg_Deckler ,

Thanks for your proposition. It is not working, probably because of the line context. But it may me think of an other way : how can I exclude the row context from the calculation.

I am thinking of using the DISTINCT on COL1, after being SUMMERIZED with your formula. Something like that, steps by steps : 

TheBigFrench_0-1706181352612.png

 

Thanks for your help.

Regards,

 

Greg_Deckler
Super User
Super User

@TheBigFrench Well, you could create a measure that you can filter on. Something as simple as:

Common = COUNTROWS(SUMMARIZE('Table', [COL1], [COL2]))

You could then filter for when Common = 2


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.