Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Inactive Relationship Column to filter table


Hello folks !

I need a solution for being able to filter a table , with a column that's linked to an inactive relationship.

For example , my table or matrix - respond to Period -> DateAdd in the above screenshot. 

 

But i need to filter it , with the same 'Period' column , but based on DateBegin. Do suggest your solutions and ideas.

6 Replies

  • Hi Anonymous ,

    According to your description, the inactive relationship cannot directly filter another table, it's by default. But there is a workaroud. Create a calculated column in Dim table.

    Related DateBegin =
    MAXX (
        FILTER ( 'Data Tbl', 'Data Tbl'[DateBegin] = EARLIER ( 'Dim'[Period] ) ),
        'Data Tbl'[DateBegin]
    )
    

    Then use this column to filter the Period column.

    My sample:

    Data Tbl table:

    Dim table:

    Result:

    I attach my sample below for your reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello v-yanjiang-msft  ,

      Take a look at this.
      Notice how the calculated column filters Dim, but not the data table.

      I guess the workaround for this would be to create another related-period column in the Data Table. Right?

       

      • v-yanjiang-msft's avatar
        v-yanjiang-msft
        Community Support

        Hi Anonymous ,

        If you want the column filter two tables at the same time, I think there should exist a active relationship between the two tables with this column.

         

        Best Regards,
        Community Support Team _ kalyj

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Arul's avatar
    Arul
    Super User

    Anonymous ,

    you can use USERELATIONSHIP function in your calculation to active this relationship,

     

    = CALCULATE(your calculation, USERELATIONSHIP(Datatbl[DateBegin], Dim[Period]))

     

    Thanks,

    • Anonymous's avatar
      Anonymous
      Not applicable

      Arul , 

      This isnt about a measure,

      can you please let me know how to build a column / workaround to filter data in a table ?

  • Hi Anonymous ,

    Is your problem solved? If so, would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirment will find the solution quickly and benefit here, thank you!

     

    Best Regards,
    Community Support Team _ kalyj