Forum Discussion

Garett52's avatar
Garett52
Frequent Visitor
7 years ago
Solved

2 Tables - show multiple options from one selection

Hi 

 

I have the following two tables: 

 

Table1

DLY                                         ID                      DLY_REASON                         DLY_MIN

2/3/2019 5:14:09AM              125631                 LATE                                       10

2/10/2019 7:57:63PM            125638                 SLOW                                      8

2/25/2019 2:14:09AM            127531                 LATE                                        5

2/28/2019 5:14:09AM            129852                 LATE                                        7

 

Table2

ID              CD               TAKEN                               ARRIVAL                               TURNAROUND

125631       A                2/3/2019 4:58:09AM         2/3/2019 5:01:09AM                   3

125631       B                2/3/2019 5:10:00AM         2/3/2019 5:15:00AM                   5

125631       C                2/3/2019 5:19:09AM         2/3/2019 5:26:09AM                   7

125632       A                2/3/2019 5:40:11AM         2/3/2019 5:44:11AM                   4

125632       B                2/3/2019 5:52:41AM         2/3/2019 5:55:41AM                   3

 

Both of these are in PowerBI as tables with a realtionship between the ID's. If I select an ID in Table1, then all instances of that ID show in Table2. How can I have Table2 show me all the instances of my selection plus the ID after it?

 

EX:  I I select the first line in Table1, I would want Table2 to show 125631 and 125632

 

Thanks

 

 

 

  • Hi Garett52 ,

     

    You need an extra table to list all unique IDs which will be added to slicer later, this table should be unrelated to both Table1 and Table2.

    Slicer Item = DISTINCT(TB1[ID])
     
    Add below measure to visual level filter.
    Measure =
    IF (
        ISFILTERED ( 'Slicer Item'[ID] ),
        IF (
            SELECTEDVALUE ( TB2[ID] )
                IN { SELECTEDVALUE ( 'Slicer Item'[ID] ), SELECTEDVALUE ( 'Slicer Item'[ID] ) + 1 },
            1,
            0
        ),
        1
    )
    Best regards,
    Yuliana Gu

2 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Garett52 ,

     

    You need an extra table to list all unique IDs which will be added to slicer later, this table should be unrelated to both Table1 and Table2.

    Slicer Item = DISTINCT(TB1[ID])
     
    Add below measure to visual level filter.
    Measure =
    IF (
        ISFILTERED ( 'Slicer Item'[ID] ),
        IF (
            SELECTEDVALUE ( TB2[ID] )
                IN { SELECTEDVALUE ( 'Slicer Item'[ID] ), SELECTEDVALUE ( 'Slicer Item'[ID] ) + 1 },
            1,
            0
        ),
        1
    )
    Best regards,
    Yuliana Gu
    • Garett52's avatar
      Garett52
      Frequent Visitor

      Hi v-yulgu-msft 

       

      Thanks for your reply. I'm still very new to PowerBI so I apologize if this is simple but I have two follow-up questions. First, in my example Table1 has some visual level filters applied to show only certain ID's, would it be possible to create a table from that using a filter on one column that only shows three of the available codes for the reference slicer?

      Second, is it possible to do this without a slicer by selecting the ID in the first table? Currently I can select (highlight?) a row in the first table and it will show me all the ID's in the second table.

       

      Thanks again