Forum Discussion
Juju123
2 years agoHelper III
DirectQuery - COUNTX very slow
Hi expert, I use function COUNTX in formula : Number reference with a gap = COUNTX(FILTER(TABLE,[MEASURE]<>0),[REFERENCE]) This formula is then used in a chart. However, the graph takes a ...
Juju123
2 years agoHelper III
Hi VahidDM ,
Thanks for your feedback.
Indeed I have a lot of data in my table and I have sensitive data.
I created all my measures in Power BI (they are all measure type columns and not calculated columns).
For this measurement: Number reference with a gap = COUNTX(FILTER(TABLE,[MEASURE]<>0),[REFERENCE])
1. I first created a “cumulative” measure
2. I created another measurement that calculates the distinct reference number.
DISTINCT REFERENCE = DISTINCTCOUNT(REFERENCE)3. I have just created this measure to calculate the measures whose accumulation is different from zero.
I changed DAX formula like this , but time it's no better
COUNTX(summarize(FILTER('TABLE_FACT','TABLE_FACT'[RUNNING_TOTAL]<>0),TABLE_FACT[REFERENCE]),[DISTINCT REFERENCE])