Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
GLIDO
Helper I
Helper I

COUNT function giving strange results

Hi there,

 

I encountered this strange result yesterday and since then trying to find the solution, I looked everywhere but unable to find the results. 

 

I created a mesure using COUT as the prime aggregation function to display the trends of a piece of data. 

The total value of the measure is totally wrong, however when it is put together with months, the distribution is CORRECT. 

Totally puzzled how to get this. 

 

Its quite urgent too. 

CountError.PNG

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @GLIDO

This is a frequent phenomenon, for example:

Assume I have this basic data

18.PNG

and I create a measure 

Measure = CALCULATE(DISTINCTCOUNT(Table1[ID]))

Then drag date field and measure into visual

19.PNG

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

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi, @GLIDO

This is a frequent phenomenon, for example:

Assume I have this basic data

18.PNG

and I create a measure 

Measure = CALCULATE(DISTINCTCOUNT(Table1[ID]))

Then drag date field and measure into visual

19.PNG

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

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.