Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
herbemischung
Resolver I
Resolver I

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:

 

Daten.jpg

 

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:

 

customers.jpg

 

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. 

gonewrong.jpg

 

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:

filteredlist.jpgb

 

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 🙂

 

1 ACCEPTED SOLUTION

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.

 

solution.jpg

 

 

 

 

 

 

 

View solution in original post

3 REPLIES 3
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.

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.

 

solution.jpg

 

 

 

 

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.