Forum Discussion
Distinctcount with sum filter
- 2 years ago
For your information, I succeeded in doing this:
VAR __tmpTable = SUMMARIZE(Table,Table[Name] ,"__Brands",SUM(Table[Quantity]))RETURN CALCULATE(DISTINCTCOUNT(Table[Name]), FILTER(__tmpTable, [__Brands]<20))
I’m sorry to hear that the formula I provided didn’t work for you. The error message “True/False expression doesn’t specify a column” usually occurs when each True/False expression used as a table filter expression must refer to exactly one column 1.
Based on the screenshot you provided, it looks like you are using an IF statement in your formula. If this is the case, you may need to wrap your IF statement in a FILTER function to fix the issue 1. Here’s an example of how you can modify the formula:
Measure = CALCULATE(DISTINCTCOUNT(Table[Column]), FILTER(Table, SUM(Table[Number]) < 20))
This formula uses the FILTER function to filter the table based on the condition that the sum of the Number column is less than 20. The DISTINCTCOUNT function then counts the number of distinct values in the Column column for the filtered table.
Regarding your question about the Date column being a page slicer, the measure will be dynamic depending on the choice in the slicer as long as all the data is in the same table.
I hope this helps! Let me know if you have any further questions.
I don't understand why you're asking me to change my formula for yours when there's absolutely no change between mine and yours.
What's more, this formula doesn't work, it returns "null".