Forum Discussion

Yogisha's avatar
Yogisha
Frequent Visitor
6 years ago
Solved

How to filter table based on one column in another table

Hi,

 

I have to filter table values based on a column from another table in Power Query. Since I am using direct query, I can't use of merge.

Is there any way to filter other than inner join?.

 

Thanks,

 

 

  • Hi Yogisha ,

    When we transform data in Power Query and create calculated tables with DirectQuery mode, the report will change to storage model. You could reference the document:About using DirectQuery in Power BI  to learn more about DQ mode.

    I'm not clear about your actual situation. If you need the report just with DQ mode, maybe you could try to create a relationship between the tables and then use slicers to filter it in report view.

     

    Best Regards,

    Xue Ding

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

2 Replies

  • Hi Yogisha,

     

    let us suppose we have below two tables.

    t1

    id    name   sal

    1     test1    10
    2     test2    20
    3     test3    30
    4     test4    40

     

    t2

    id    Dept

    1     IT
    2     IT
    3     Sales
    4     IT

     

    We can create a calculated table with the following dax if the data is in direct query mode.

     

    Table =

    var t2_TREATA= TREATAS(t2,t1[id],t2[dept])
    var result= NATURALLEFTOUTERJOIN(t1,t2_TREATA)
    return result
     
  • v-xuding-msft's avatar
    v-xuding-msft
    Icon for Community Support rankCommunity Support

    Hi Yogisha ,

    When we transform data in Power Query and create calculated tables with DirectQuery mode, the report will change to storage model. You could reference the document:About using DirectQuery in Power BI  to learn more about DQ mode.

    I'm not clear about your actual situation. If you need the report just with DQ mode, maybe you could try to create a relationship between the tables and then use slicers to filter it in report view.

     

    Best Regards,

    Xue Ding

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