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
AC2982
New Member

Sometimes Incorrect Sum

Hi -- I am building a PowerBI dashboard for an HIV program and I've run into an issue with a calculated measure (see formula below).  When I use this measure in a guage or multi-row card, the totals are correct.  But when I put this measure into a graph, the total are off.  I cannot figure out why.  The data are structured really simply in a single column for daily targets and their associated date.  Ive got the date linked up to another date table so I can include a date slicer.  But again... it is working on the guage and multi-row card.  What am I missing??

 

calculate(sum('HIV Tx Targets'[tx_new]), USERELATIONSHIP('HIV Tx Targets'[date], Dates[date]))
5 REPLIES 5
Anonymous
Not applicable

Hi @AC2982 ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Thank you.

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

Hi @AC2982 ,

 

I have constructed some data and everything looked fine on my side.

12.9.3.1.PNG

Could you please take a look at my pbix file and explain your queation detailly?

https://qiuyunus-my.sharepoint.com/:u:/g/personal/stephent01_qiuyunus_onmicrosoft_com/EYjr3ZmaaoFMhE...

 

Best Regards,
Eyelyn Qin

PaulDBrown
Community Champion
Community Champion

@AC2982 

If you are only using the HIV Tx Targets'[date], then you only need to link this field to your date table in a one-to-many relationship (make sure the date table covers the range of dates in the dataset and that dates are contiguous - if you are unsure how to create it, just use the table function CALENDARAUTO() ). You then don´t need the USRELATIONSHIP function: a simple SUM will work. 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thanks.  I tested this out with and without the userelationship function and the performance is still inconsistent.  The guage total is correct -- and filters correctly with the date slicer.  But the graphs have a different total.

@AC2982 

It would really help if you could provide a sample of your data and/or PBIX file to work on.

Please read this thread for more pointers:

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.