Forum Discussion

TheBigFrench's avatar
TheBigFrench
Regular Visitor
2 years ago
Solved

Visualize links between data

Hi, How can visualize the link between data, in a single table. Here is a very simple example  : COL1 COL2 A XX B XX C XX A YY E YY F XX F YY H YY I XX J...
  • Daniel29195's avatar
    2 years ago

    TheBigFrench 

     

    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 👍🤠