Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

use list as a filter

Hi everyone,

 

I already tried to share my issue with the community here (https://community.powerbi.com/t5/Desktop/How-to-filter-a-measure-by-measure/m-p/400598#M183025), but the subject didn't quite fit and now I am trying another approach:

 

This is my Table:

 

 

I want to know all Customers with sales in Quarter 1 last year and no sales in Quarter 1 this year. Thats pretty easy so far:

I created 2 measures:

Sales_this_year = totalytd(sum(TableA[SalesAmount]);TableA[Date].[Date])

Sales_last_year = calculate([sales_this_year];Previousyear(TableA[Date].[Date]))

 

Then I filtered the following List by sales_this_year = 0 and added a Slicer for date = 2018:

 

 

Now I am interested if they have something in common. Are buyers of some specific articles more likely not to purchase again at all? So I drag the arcticle above customer. 

 

As you can see, the total amount rises because now I get the sales_last_year from every ARTICLE that has no sales_this_year. 

 

I found a workaround but it is not very practicable (to many customers):

I made a second list with all articles and by clicking on the customers in the original list I get what I want in the second list:

b

 

but I would have to click on all 200 Customers and I this would not be a useful report. It would be great if I could just say: Filter List A by List B - but I fear thats not how this works.

 

I spent a long time thinking how to solve this one and I faild miserably. Any help would be very welcome, tnx :)

 

  • Anonymous's avatar
    Anonymous
    8 years ago

    I (kind of) found a solution

     

    but I hope anyone can think of a more sophisticated one.

     

     

    1) I added a conditional column. 2018 = If Year is 2018 then SalesAmount else 0.

    2) I made a copy of the wholeTable and used Group by
    --> Group by "Customer", New Column name= 2018_sum, Operation: Sum, Column 2018

    3) I created a 1:n connection (Customer) between the original table and the new one 

     

    and finally I made a Page level filter: 2018_sum is 0 or is blank

     

    So I filtered out all customers with Sales in 2018 and my list with articles has the same sum as the list of customers ;)

     

    The downside of this approach is, that I have to add a new column for each year.

     

     

     

     

     

     

     

     

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable
    Do you have any example data you can share? If you cannot share it can you make a dummy set that exhibits the same issue.
    • Anonymous's avatar
      Anonymous
      Not applicable

      I (kind of) found a solution

       

      but I hope anyone can think of a more sophisticated one.

       

       

      1) I added a conditional column. 2018 = If Year is 2018 then SalesAmount else 0.

      2) I made a copy of the wholeTable and used Group by
      --> Group by "Customer", New Column name= 2018_sum, Operation: Sum, Column 2018

      3) I created a 1:n connection (Customer) between the original table and the new one 

       

      and finally I made a Page level filter: 2018_sum is 0 or is blank

       

      So I filtered out all customers with Sales in 2018 and my list with articles has the same sum as the list of customers ;)

       

      The downside of this approach is, that I have to add a new column for each year.