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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.