Forum Discussion

ephramz's avatar
ephramz
Helper II
4 years ago
Solved

Filter pane function

I have two tables.

Table 1 with all the raw data imported from SQL database

Table 2 with all my own data imported from excel

 

Table 1 and Table 2 both have  two column namely (Strategy) and (Package).

I want to make use of the filter pane function in PowerBI, to filter matching (Strategy) and (Package) available in Table 2 in Table 1
I'm aware of the merge query approach, however I would like to reduce the space capacity and just make use of the filter pane function to quickly edit my selections. 
Or perhaps I can create a new column in Table 1 and quickly make use of the filter pane/slicer. If so, what is the equivalent DAX function for it

How can I achieve that?

Thanks.

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi ephramz ,

     

    You could create a measure like below.

    measure = IF(selectedvalue(table1[strategy]) in values(table2[strategy])&&selectedvalue(table1[package]) in values(table2[package]),1,0)

    Then add this measure to visual filter and filter measure =1. This will filter the records in table1 have both strategy and package in table2.

    You could change the && symbol in the formula to || symbol. This will filter the records in table1 have strategy or package in table2.

    If I misunderstand your requirement, please show some sample data and expected result to us.

     

    Best Regards,

    Jay

3 Replies

  • Hi ephramz 

     

    Is there any relationship between those 2 tables?

    you can use LOOKUPVALUE dax code to create a new column in Table 1.

     

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

    Appreciate your Kudos!!

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ephramz ,

     

    You could create a measure like below.

    measure = IF(selectedvalue(table1[strategy]) in values(table2[strategy])&&selectedvalue(table1[package]) in values(table2[package]),1,0)

    Then add this measure to visual filter and filter measure =1. This will filter the records in table1 have both strategy and package in table2.

    You could change the && symbol in the formula to || symbol. This will filter the records in table1 have strategy or package in table2.

    If I misunderstand your requirement, please show some sample data and expected result to us.

     

    Best Regards,

    Jay

  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    Ideally you should create Dimension tables with unique values for Strategy  and Package  and join these with the corresponding fields  in each fact table (& a Date table if dates are involved)

    You then use the fields from the dimension tables in measures, slicers, filters, visuals....