Forum Discussion
A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter exp
First, let me apologize as this is probably super simple, but I have been trying and reading and trying to no avail. I am trying to get a number of repeat customers based on two measures; Total Customers and Total Orders where total orders is > 1. My table consists of one order per record. Below is what I have. Thank you in advance!
It does take some getting used to but what you need to do is build the list of customers that match your criteria ([Total Orders] > 1) and use that list as the argument in the calculate. We do that using FILTER over the list of unique customers (Cutomer ID, Customer Number, Customer Key, whatever it is in your model).
It looks like this:
Repeat Customers = CALCULATE ( [Total Customers], FILTER ( VALUES ( Customer[CustomerKey] ), [Total Orders] > 1 ) )You can simplify it by just counting the list of filtered customers like this:
Repeat Customers = COUNTROWS ( FILTER ( VALUES ( Customer[CustomerKey] ), [Total Orders] > 1 ) )
4 Replies
- jdbuchanan71Super User
It does take some getting used to but what you need to do is build the list of customers that match your criteria ([Total Orders] > 1) and use that list as the argument in the calculate. We do that using FILTER over the list of unique customers (Cutomer ID, Customer Number, Customer Key, whatever it is in your model).
It looks like this:
Repeat Customers = CALCULATE ( [Total Customers], FILTER ( VALUES ( Customer[CustomerKey] ), [Total Orders] > 1 ) )You can simplify it by just counting the list of filtered customers like this:
Repeat Customers = COUNTROWS ( FILTER ( VALUES ( Customer[CustomerKey] ), [Total Orders] > 1 ) )- YcnanPowerBIHelper II
This worked! Thank you so much!!!!
- AhmedxSuper User
try this
CALCULATE([TOTAL Customers],FILTER(ALL(Yourtable),[TOTAL Order]>1))
- AhmedxSuper User
You can read more about the error here
https://www.sqlbi.com/articles/solving-errors-in-calculate-filter-arguments/