Forum Discussion
Calculating a count across disconnected tables
- 5 years ago
jackj usually in scenarios like this you should have a common dimension table with a unique user id and link these two together, anyhow try the following expression to get the count:
Count = CALCULATE ( COUNTROWS ( Customer ), TREATAS ( VALUES ( Visits[UserId] ), Customer[CustomerId] ) )Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
jackj usually in scenarios like this you should have a common dimension table with a unique user id and link these two together, anyhow try the following expression to get the count:
Count =
CALCULATE (
COUNTROWS ( Customer ),
TREATAS ( VALUES ( Visits[UserId] ), Customer[CustomerId] )
)
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- jackj5 years ago
Helper I
Thank you! This worked for the count. One other question - how could I do something similar to be able to do a sumif-like function rather than a count with this same data, i.e., taking the sum of sales in the "orders" table based on the userID from the "visits" table?