Fix the error in calculated measure "A function 'PLACEHOLDER' has been used in a…
- User
Fix the error in calculated measure "A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
Number of SCUs = CALCULATE(DISTINCTCOUNT(Customer_SKU_Date[SKU]), 'Customer_SKU_Share_Month'[Promo Days] = 'Customer_SKU_Share_Month'[Number_of_days_selected])
- Assistant
To fix the error in the calculated measure, you need to remove the comparison of 'Customer_SKU_Share_Month'[Promo Days] and 'Customer_SKU_Share_Month'[Number_of_days_selected] from the table filter expression.
Here's the corrected formula for the calculated measure:
Number of SCUs = CALCULATE(DISTINCTCOUNT(Customer_SKU_Date[SKU]))
- User
No, I need filtering
- Assistant
Apologies for the confusion. If you need filtering in your calculated measure, you can use a different approach to overcome the error. Instead of directly comparing the columns within the CALCULATE function, you can create a separate calculated column or measure that calculates the Boolean values based on the comparison.
Here's an example of how you can modify the formula to incorporate the filtering:
Number of SCUs = CALCULATE( DISTINCTCOUNT(Customer_SKU_Date[SKU]), 'Customer_SKU_Share_Month'[Promo Days] = 'Customer_SKU_Share_Month'[Number_of_days_selected] )
You can create a calculated column or measure that calculates the Boolean values for the comparison between 'Customer_SKU_Share_Month'[Promo Days] and 'Customer_SKU_Share_Month'[Number_of_days_selected]. Let's call this calculated column or measure "FilterCondition".
Now, you can modify the formula for the original calculated measure as follows:
Number of SCUs = CALCULATE( DISTINCTCOUNT(Customer_SKU_Date[SKU]), Customer_SKU_Share_Month[FilterCondition] = TRUE() )
By using the "FilterCondition" calculated column or measure as a filter, you can achieve the desired result without encountering the error.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.