Forum Discussion
dwel0120
3 years agoHelper III
Filter Function across two tables
I have some dummy data in the two tables below. I am trying to build measures with the Table 2 data but I want to filter the results to only include "banana" from Table 1. I am unable to get the ...
- 3 years ago
I couldn't get it to work. I used KEEPFILTERS and I got it working.
jgeddes
3 years agoSuper User
If you are looking for a result like
I created the two tables you provided, without a relationship between them, and then wrote the following measure
Ripe Percentage =
var _ripeCount =
CALCULATE(
COUNT(ripeTable[RipeTest]),
TREATAS(VALUES(productTable[Product#]),ripeTable[Product #]),
FILTER(ripeTable, ripeTable[RipeTest] = 1)
)
var _productCount =
COUNT(productTable[Product])
return
DIVIDE(_ripeCount, _productCount, 0)
Hope this helps.