Reply
ZachRoberts
Frequent Visitor
Partially syndicated - Outbound

Table not calculating sum correctly

Hello,

 

I have the below data and for some reason when I set the value of my Hours field below to Sum of Hours it doubles the data instead of giving a correct sum.

 

WorkerHoursDate
W0.014/29/2021
W1.614/29/2021
W1.674/29/2021
W7.644/29/2021

 

When I change Hours to Sum of Hours I get the below result

WorkerSum of HoursDate
W21.864/29/2021

 

The expected result is 10.93 but for some reason Power Bi appears to be doubling the values it is summing. 

 

Any help would be appreciated.

 

Thanks,

Zach 

 

 

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

Syndicated - Outbound

Hi @ZachRoberts ,

 

One reason is that there are duplicate identical rows. It will not display duplicate rows in Power BI. Please check whether there are duplicate rows in your data source table.

11.png10.png

 

The solution is to add an index column.

12.png13.png

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.v

View solution in original post

10 REPLIES 10
v-stephen-msft
Community Support
Community Support

Syndicated - Outbound

Hi @ZachRoberts ,

 

One reason is that there are duplicate identical rows. It will not display duplicate rows in Power BI. Please check whether there are duplicate rows in your data source table.

11.png10.png

 

The solution is to add an index column.

12.png13.png

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.v

Syndicated - Outbound

Yea there does appear to be duplicate entries in our data - started with just my table of the hours and worked through it there to find the issue. Will work to fix why we have duplicate entries now haha 

 

Thanks everyone for your help

Ashish_Mathur
Super User
Super User

Syndicated - Outbound

Hi,

Drag Worker to the Table visual and write this measure

Hours worked = sum(Data[Hours])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Syndicated - Outbound

@Ashish_Mathur thank you for the reply but that didn't work for me still got the doubled value 

Syndicated - Outbound

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
HashamNiaz
Solution Sage
Solution Sage

Syndicated - Outbound

Hi @ZachRoberts !

 

Pleae make sure you don't have any active relationship which are causing this. Please paste your Data Model diagram here.

 

Regards,

Hasham

Syndicated - Outbound

@HashamNiaz ,

 

Thanks for the reply - Please see the below screenshots of the relationship

 

BI_01.png

BI_02.png

 

Thanks,

Zach 

Syndicated - Outbound

Hi @ZachRoberts !

 

Please check by placing columns only from [JCT] table into table / matrix visual if you are able to get correct result for particular day.

 

Regards,

Hasham

Syndicated - Outbound

Please see the screenshot below - all fields are from the JCT table 

 

BI_03.png

Is it an issue with the values and how they related to the date fields? Would still expect the hours to be able to sum for the correct value though

 

Thank you

Syndicated - Outbound

Hi @ZachRoberts !

 

Try to remove Consumption Date from visual. Also please share sample file as some relationship is causing the duplicates to be reurned.

 

Regards,

Hasham

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)