Forum Discussion

danielru's avatar
danielru
Frequent Visitor
1 year ago
Solved

how to filter a table visual

Hi, 

 

I have 3 tables- customers, products and sales.

 

My table visual has the following columns from:

 

customer- customer name, customer id;

 

products- product id, product name, product price;

 

sales- product id, quantity, sales rep name.

 

Now, I want to filter the visual such that all rows where 'customer name' is not equal to 'sales rep name'. Remember that these column in the table visual come from the customer and sales source tables respectively. How would you filter the table visual for this requirement? 

 

I have other filters on this table visual and tried to apply a new measure which exploded my table from 3 rows to an error message that I exceeded the limits.

 

I would be grateful for any advice. Thank you so much!

 

Regards,

 

Daniel

  • danielru 

     

    You can create a calculated column in the sales table:

     

    IsCustomerNotSalesRep =
    IF (
    RELATED(Customers[customer name]) <> Sales[sales rep name],
    1,
    0
    )

     

    Once you have the calculated column, you can apply a filter to your table visual to only include rows where this column is 1.

2 Replies

  • danielru 

     

    You can create a calculated column in the sales table:

     

    IsCustomerNotSalesRep =
    IF (
    RELATED(Customers[customer name]) <> Sales[sales rep name],
    1,
    0
    )

     

    Once you have the calculated column, you can apply a filter to your table visual to only include rows where this column is 1.