Forum Discussion
Petegdl23
2 years agoNew Member
How to use or function with filters
I am getting ask to modify a report. I need to report revenue for a set of customers plus any customer that has aquired some specific products. I am trying to use the below query but I am getting...
- 2 years ago
I was able to solve it like this. I created two separate measures, one with filters by customer numbers and another one with products filtered. Then I created a third measure that sum boths and that's it.
lbendlin
Super User
2 years agoYou don't really need an explicit FILTER for this
Channel Customer = CALCULATE (
SUM ( 'Finance fact_Revenue_Lines'[Total_Amount] ),
CONTAINSSTRING ( 'Finance dim_GL_Item'[Product_Level_2], "Product Name" )
|| CONTAINSSTRING ( 'All dim_Customer'[Customer_Number] , "4066-01" )
)
govindarajan_d
Super User
2 years agoI don't think it will work:
1. Given that filter conditions that use two different columns cannot be written in this way
2. OP had not used ALL in his filter function. Implicit filters apply ALL on the table before filtering
For more info:
https://www.sqlbi.com/articles/specifying-multiple-filter-conditions-in-calculate/
- lbendlin2 years ago
Super User
govindarajan_d you are right, I forgot about that limitation.