Forum Discussion
DistincCount with Filter
- 2 years ago
The solution will works. Please try copy it carefully. Then click accept solution. Thanks.
Answer =VAR tempfile = FILTER('yourtable',NOT LEFT('yourtable'[PRODUCT NUMBER],1) IN {"2","3"})RETURNCALCULATE(DISTINCTCOUNT('yourtable'[PRODUCT NUMBER]),tempfile)
We want to help you but your description is too vaugue. Please write it again clearly.
Please DON'T copy & paste your DAX that does not work and expect us to fathom what you want to do. That would be crazy. 😀
Please just give a simple non technical functional decscription of what you want, then let us suggest the DAX. Thank you.
Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.
Also provide the example desired output, with a clear description of the process flow.
Remember not to share private data ... we don't want you to get into trouble. 😧
Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you.
You will get a quick response if you put time, care and effort into writing clear problem descriptions.
Vaugue descriptions can waste your time and ourtime.
Look foward to helping you when the above information is forthcoming
- Oros2 years agoPost Prodigy
Hi speedramps,
Thank you for your comment.
I have a sample table with only one column like this. What measure to use to count the number of distinct products, EXCLUDING products that start in number 2 and number 3? Thanks again.
PRODUCT NUMBER 10023 10024 10025 20018 20019 20020 30009 30010 - Daniel_PowerBI2 years agoAdvocate I
That should do it:
Distinct count =CALCULATE(DISTINCTCOUNT('Table'[PRODUCT NUMBER]),LEFT('Table'[PRODUCT NUMBER]) <>"2" && LEFT('Table'[PRODUCT NUMBER]) <>"3")