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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JoeKulasa
Regular Visitor

Running total not calculating correctly

I have a the following measure:

 

JoeKulasa_0-1618401257404.png

 

The measure is calculating a running total of another calculated column:  

JoeKulasa_1-1618401316618.png

 

Problem:   The measure is calculating correctly on some lines, but seems to be adding values incorrectly.  Notice some lines should increase in "Difference" by .01, but they are increasing by .02.  Please let me know if you can help!

JoeKulasa_2-1618401363479.png

 

3 REPLIES 3
v-lionel-msft
Community Support
Community Support

Hi @JoeKulasa ,

 

If the [Difference] field is not summarized, is the result of the measure correct? If not, please provide a sample .pbix file(remove sensitive information).

 

Best regards,
Lionel Chen

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

JoeKulasa
Regular Visitor

@amitchandak 

Thanks - Index looks like it works properly, but I need the value to reset at the start of every new shift.  This is the purpose of Rank.  See below:

 

  • Rank doesn't add correctly, but resets @ shift change, which allows the measure to reset to 0
  • Index adds correctly, but doesnt reset @ shift change

JoeKulasa_0-1618408227218.png

JoeKulasa_1-1618408253989.png

 

amitchandak
Super User
Super User

@JoeKulasa , if rank is column the first one should work

 

for the second one, index is a column, then try measure like

 

Calculate(Sum(Table[Hour]), filter(Table, Table[Index] <= Max(Table[Index])))

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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