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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.