Forum Discussion

Jot's avatar
Jot
Frequent Visitor
8 years ago
Solved

Display only value on given day

Hi, I'm creating a report which comprises a parent table with a number of child tables which have a [begin_date] and [end_date]. The report (all its visuals) is supposed to show only the child table ...
  • v-jianhe-msft's avatar
    8 years ago

    Hi,

     

    So you wish to make the bunch of child tables get filtered at one time, controlled by a slicer or a parameter, and what you do not want is to set the filter one by one for the child tables, right?

     

    If so, I think the point is not a slicer or parameter or page filter, but the relationships of the tables. Because there are not relationships among these tables, they will not get filter at one time. So it is important to establish a “common table” to connect to these child tables. In my case, I create two common tables, one for begin_date and the other for end_date.

     

    Below are my steps:

    1. The parent table together with three child tables I use:
      1. After loading them to power bi, create two more new tables using DAX:
    2.  

        begindate table =    DISTINCT(UNION(SELECTCOLUMNS(child1,"begin_date",child1[begin_date]),SELECTCOLUMNS(child2,"begin_date",child2[begin_date]),SELECTCOLUMNS(child3,"begin_date",child3[begin_date])))

       

       

       

      end_date table = DISTINCT(UNION(SELECTCOLUMNS(child1,"end_date",child1[end_date]),SELECTCOLUMNS(child2,"end_date",child2[end_date]),SELECTCOLUMNS(child3,"end_date",child3[end_date])))

       

    3. Manage relationships for tables, connect begin_date table with three child tables, similarly, connecting end_date table with three child tables. Noted it is important to use "single " cross filter for all the relationships when building the relationships. 

     

     

    4.  Add two slicers for begin_date and end_date, when filtering, all three child tables can be filtered at one time.

    5. If you want to use parameter, you could add parameter on the begin_date table and end_date table, then three child tables will get filtered as well.

     

    Best Regards,

    Henry