Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Filtering one dataset two ways from the same filter

Folks,

 

I have a question about how to link tables for filtering in Power BI.

 

Here’s the situation. We have Salespeople. We have Sales. Sales have Customers.

 

Sometimes a given salesperson will be removed from a customer and another sales person will be assigned to that customer

 

So three tables: Salespeople, Sales, Customers.

 

For each sale we know which sales person got credit for that sale. It’s in that column of the Sales table that doesn’t change if that customer is assigned a new salesperson.

 

For each customer we know who their CURRENT sales person is. That’s a column in the Customer table.

 

So our tables are like this:

 

Salesperson --> Sales
Customer --> Sales
Salesperson --> Customer

 

Are you starting to see the issue?

 

When I filter by Salesperson, I’d like to have two different Power BI Visuals on the same report, one showing all the SALES that this salesperson gets credit for, and one showing all the sales for all of the CUSTOMERS that this salesperson is currently assigned to.

 

Is there a nice way to do that? A way that doesn’t involve duplicating tables?

 

Thanks!

 

Dave

3 Replies

  • Anonymous 

    I am making an assumption that the primary relationship for most reporting is Rep > Customer > Sales meaning the current owner is used for most reporting.  You could set your model up like this:

    Then you have a measure to sum the sales which is just

    Sales = SUM ( Sales[Amount] )

    And when you need to calculate the amounts by the order rep you have a measure for that which activates the link between sales person and sales.

    Sales by Order Rep = 
    CALCULATE(
        [Sales],
        USERELATIONSHIP(Salesperson[Sales_Person_ID],Sales[Sales_Person_ID])
    )

    I have attached my sample file for you to look at.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Cool!  Thanks much!  I'll give it a try!

      (I like this community!)

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Did the above solution solve your problem?

     

    Best Regards,

    Jay