Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Select column values which is missing on another table

Team, I have two Table like below

Table 1

value12020/01
value22020/02
value32020/03
value42020/04
value52020/05
value62020/06

 

Table 2

value1
value2
value3
value4
value5
value6

 

When I display values in chart, we will filter 1st Table with date coumn and that works fine. What I want is, I want to show another chart with missing data in the Table 1. which is like if I select date filter as 2020/01, I want to see value2, value3, value4, value5 and value6

Could someone help?

8 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    Anonymous 

    How is yor model set up? Are both tables related?

    • Anonymous's avatar
      Anonymous
      Not applicable

      PaulDBrown I havent enabled the relationship now. If required, I can do that.

      • PaulDBrown's avatar
        PaulDBrown
        Community Champion

        Anonymous 

         

        Here is one way. First, the model:

        Now create a measure to identify the rows which are excluded from the selection in table 1:

        Non Selected Table 2 Values =
        VAR SelT1 =
            VALUES ( Table1[Table1 Values] )
        VAR T2Values =
            CALCULATETABLE (
                VALUES ( Table2[Table2 Values] ),
                ALL ( Table1[Table1 Values] )
            )
        RETURN
            IF (
                ISFILTERED ( Table1[Table1 Period] ),
                COUNTROWS ( EXCEPT ( T2Values, SelT1 ) ),
                1
            )

        Create the report page, select Table 2 and add this measure to the "Filters on this visual" in the filter pane and set the value to 1.

        And you get this:

         

    • Anonymous's avatar
      Anonymous
      Not applicable

      PaulDBrown I am fine with any solution, may be creating a new table/column with missing data and displaying or by using measures on existing column.

  • Anonymous's avatar
    Anonymous
    Not applicable

    awesome PaulDBrown . That worked fine. I selected wrong tables and caused the issue. Thank you so much for your help.