Forum Discussion
Countrows in a summarize argument
Hello,
I'm very confused about a grouped table with an aggregated function. I will show whats happening in DaxEditor. My table:
| Serialnumber | Status |
| BF33333 | K |
| BF33334 | K |
| BF33335 | K |
| BF33336 | K |
| BF33337 | K |
| BF33338 | V |
| BF33339 | V |
| BF33340 | V |
| BF33341 | V |
| BF33342 | V |
After summarizing I get the following table:
summarize(Tabelle2,[Status],"Name",COUNTROWS(Tabelle2))
As seen here are two rows as a return, but why I get the values of 20 after wraping it into a sumx-function?:
SUMX(summarize(Tabelle2,[Status],"Name",DISTINCTCOUNT(Tabelle2[Status])),countrows(Tabelle2))
Shouldn't the expected outcome be 10?
Best.
Applicable88 , this should give you 10
SUMX(summarize(Tabelle2,[Status],"_cnt",DISTINCTCOUNT(Tabelle2[Status])),[_cnt])
20, I am not sure, may be
SUMX(summarize(Tabelle2,[Status],"_cnt",COUNT(Tabelle2[Status])),[_cnt])
3 Replies
- amitchandakSuper User
Applicable88 , Are you only counting status
try like
countrows(summarize(Tabelle2,[Status],"Name",DISTINCTCOUNT(Tabelle2[Status])))
- Applicable88Impactful Individual
Hi amitchandak ,
with your function I get 2, which also make sense.
But my question is, why do I get 20? And how to return 5+5=10?
Since I build the summarize table in the first screenshot, I want to summarize the counts of serialnumbers per row. Which I don't understand why it does not leads to 10 .
- amitchandakSuper User
Applicable88 , this should give you 10
SUMX(summarize(Tabelle2,[Status],"_cnt",DISTINCTCOUNT(Tabelle2[Status])),[_cnt])
20, I am not sure, may be
SUMX(summarize(Tabelle2,[Status],"_cnt",COUNT(Tabelle2[Status])),[_cnt])