Forum Discussion
JohnnyDax2
3 years agoNew Member
DAX Performance issue FILTER
Hi everyone, I'm experiencing a performance issue with a dataset. The use case is to count to number of distinct store that are active. I used to do DISTINCTCOUNT(Sales[Store_key]) Unfortunatl...
Anonymous
3 years agoNot applicable
Hi JohnnyDax2 ,
You can try the following measure:
Flag =
var _table=
SUMMARIZE('Table','Table'[Store],"Sum",SUMX(FILTER(ALL('Table'),'Table'[Store]=EARLIER('Table'[Store])),[Sales]))
var _select=
SELECTCOLUMNS(FILTER(_table,[Sum]>0),"1",[Store])
return
CALCULATE(
DISTINCTCOUNT([Store_key]),FILTER(ALL('Table'),'Table'[Store] in _select))
Result:
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
In your last two sentences, I'm not quite sure what you mean by whether the expected result is represented in the form of a picture.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.