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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.