Forum Discussion
COUNT function giving strange results
- 8 years ago
hi, GLIDO
This is a frequent phenomenon, for example:
Assume I have this basic data
and I create a measure
Measure = CALCULATE(DISTINCTCOUNT(Table1[ID]))
Then drag date field and measure into visual
the total is 3 not 3+3+2=8
The reason for that is row value is calculated for current row context, total value is calculated for whole table
for 2018/01, it is it has three different value 1/2/3, so result is 3
for 2018/02, it is it has three different value 1/2/3, so result is 3
for 2018/03, it is it has three different value 1/2, so result is 2
for total value, it is it has three different value 1/2/3, so result is 3 not 3+3+2=8
So the total value is not always same with sum for every row value.
If it is not your case, please share your simple pbix file or some data sample with model structure and expected output. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.
Best Regards,
Lin
hi, GLIDO
This is a frequent phenomenon, for example:
Assume I have this basic data
and I create a measure
Measure = CALCULATE(DISTINCTCOUNT(Table1[ID]))
Then drag date field and measure into visual
the total is 3 not 3+3+2=8
The reason for that is row value is calculated for current row context, total value is calculated for whole table
for 2018/01, it is it has three different value 1/2/3, so result is 3
for 2018/02, it is it has three different value 1/2/3, so result is 3
for 2018/03, it is it has three different value 1/2, so result is 2
for total value, it is it has three different value 1/2/3, so result is 3 not 3+3+2=8
So the total value is not always same with sum for every row value.
If it is not your case, please share your simple pbix file or some data sample with model structure and expected output. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.
Best Regards,
Lin