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

My first Report - need a cumulative line?

Hi, I am building my first report but now need a Cumaltive count line adding.  Below is my simple Graph which shows a field "Income" shown across time.  Bars below the line are Costs and Bars above the line are income.  I need a cumalative line adding which adds the values up cumalatively to show my current £ balance.

 

I assume I create a new column which i can then add onto the graph.  What would be the formula for this new column?

 

Thanks in advance.

 

Steve

 

Untitled.png

 

 

2 REPLIES 2
AlexChen
Employee
Employee

Hi,

 

I assume you have a table below.

 

2.png

 

You can add a measure to your table:

 

balance = CALCULATE(SUMX(tablex, tablex[cost] + tablex[income]), Filter(ALLSELECTED(tablex), tablex[Index] <= max(tablex[Index])))

 

Now you can create a chart to show your balance with a cumalative line.

 

3.png

 

Best Regards

Alex

 

Anonymous
Not applicable

I'll assume you have a column called "Amount".

 

In theory, your existing graph would have been made by using a measure:

  Total Amount := SUM(MyTable[Amount])

 

And a cumulative total would look something like:

  Running Total Amount := CALCULATE([Total Amount], FILTER(ALL(MyTable[Date]), MyTable[Date] <= MAX(MyTable[Date]))

 

The answer would be slightly different if your model contained a separate Calendar table (which, generally... it should).

 

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.