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
tameemyousaf
Helper I
Helper I

Running Total Using Two Measures

Hi,

 

I want to get the running total of by adding two measures. I have two measures "Stock def" and "Store Qty". I need running total by adding both measures. Below is the screenshot of data and my requirement (yellow highlighted).

 

How can I do this?

 

RunningTotal.jpg

 

 

3 REPLIES 3
sekhar438
Frequent Visitor

Any solutions for this question.

BraneyBI
Kudo Commander
Kudo Commander

Hi @tameemyousaf,

I would suggest creating a new "Index" column in Power Query so that the sort can be established.  Once you do that, the Column you can create has the following syntax: 

 

Running Total = CALCULATE(SUM(Qty[Store Def])+SUM(Qty[Store Qty]),FILTER(Qty,Qty[Index] <=EARLIER(Qty[Index])))

 

CumulativeTotal.JPG

 

 

 

 

 

Hi @BraneyBI

 

Thanks for your reply.

The issue is that data is populating from two different tables and from two different measure. "Store Def" and "Store Qty" are actually two different measure. We can not use sum function on any of these measures and we can not use "EARLIER" on any measure. In your proposed solution your are taking "Store Def" and "Store Qty" as table columns and you are considering the whole data in one table but actually this grid is not populating from only one table. I can not create index on any table. 

I have tried creating index using RANKX function but that can not be used with EARLIER function.

 

Is there any other solution?

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.