Forum Discussion

pr92's avatar
pr92
Frequent Visitor
3 years ago
Solved

Filter visual based on slicer on column from another table

Hello,

 

I have the following database model with 3 tables : Clients, Sales, DateTable

 

 

"Clients" is linked to "Sales" on "client_id"

"Sales" is linked to "DateTable" on "order_date"

 

I have a date slicer that takes the column "order_date" to filter the visuals.

I added a card with the SUM of "client_wallet"

 

 

 

However what I need is for this card to change its value according to the date filtered.

 

I need to SUM the value of "client_wallet" according to the date chosen by the user.

The equivalent in SQL would be : 

 

SELECT SUM(client_wallet)

FROM Clients INNER JOIN Sales on Clients.Client_id = Sales.Client_id

 

Is there any way to create a similar measure in DAX ?

 

Thank you

  • Hi pr92 ,

     

    For the sake of simplicity, I'd just change the relationship between Clients and Sales to bi-directional.

    As an aside - once you have a properly-related calendar table, you should be using the calendar fields in slicers and visuals, not the fact fields.

     

    Pete

2 Replies

  • Hi pr92 ,

     

    For the sake of simplicity, I'd just change the relationship between Clients and Sales to bi-directional.

    As an aside - once you have a properly-related calendar table, you should be using the calendar fields in slicers and visuals, not the fact fields.

     

    Pete

    • pr92's avatar
      pr92
      Frequent Visitor

      Thank you - that worked.