Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Line chart issue with running totals

Hello,

 

I created this Power BI chart:

Almost right, but one of the numbers (36,994) is incorrect. Desired output (from Tableau):

I understand what is happening: bottom line ("Actuals") is a running sum. Dotted line is "Initial budget". Red line should be the difference between the two but it does not seem to consider "Actuals" as a running total. Instead 36,992 should be 38,746-3,307=35,439

I cannot post the file as it containss confidential information, unless I create some dummy data.

 

But maybe somebody can help just looking at the measures below?

 

Initial Budget = calculate(sum([Initial Budget calc])) --- works correctly
Actuals (hours) = calculate(sum([Actuals calc]), FILTER(ALL(Overhead_new[Date]),Overhead_new[Date]<=max(Overhead_new[Date])) -- works correctly
Available Budget = [Initial Budget]-[Actuals (hours)] -- does not work as expected.
 
Regards.
 

 

  • Hi,

    You have written available budget as a calculated column formula.  Write that as a measure instead.  This is the result you will see

7 Replies

  • Hi,

    You should ideally have a Calendar Table with calculated columns for Year, Month name and Month number.  Sort the Month name by the Month number.  Create a relationship from the Date column of the Overhead_New table to the Date column of the Calendar Table.  To your visual, drag Year and Month Name from the Calendar Table.  Write these measures

    Initial Budget = sum([Initial Budget calc])

    Actuals (hours) = calculate(sum([Actuals calc]),datesytd(calendar[date],"31/12"))

    Available Budget = [Initial Budget]-[Actuals (hours)]

    Hope this helps.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you Asish for your help. I did as you suggested but no luck:

       

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Cannot find any upload option.

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Icon for Super User rankSuper User

      Hi,

      You have written available budget as a calculated column formula.  Write that as a measure instead.  This is the result you will see