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.
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 🙂
Solved! Go to 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.
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.
Here is a sample of the data and the template
https://www.dropbox.com/s/1p3le567dcjzxwh/Sampledata.xlsx?dl=0
https://www.dropbox.com/s/y8lfe15kwb0jgyf/sampledata.pbit?dl=0
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
99 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |