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
mdhenzel
Frequent Visitor

Running Total Measure that goes by row and column in Matrix if possible..

Hi All, This is something that is probably not possible, but I would like to ask first before giving up. I am building a running inventory visual for an area of a report. I used a measure that has worked before for me, but that was for looking at a material overall across time. Now, doing it by customer and material throws it off. Is it possible to have this measure work top to bottom or something? Example: June 29th top value of 19 (not -1), then the lower would still take the 3 off for the total of 16. I have it down to the day to solve issue, but data will be looked at as month to month.  

 

mdhenzel_1-1656514342156.png

 

 

 

 

3 REPLIES 3
amitchandak
Super User
Super User

@mdhenzel , Not very clear. But you use a date table and use that in visual too

 

then this will only give cumulative across date for material/customer combination

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

 

or allselected

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected('Date'),'Date'[date] <=max('Date'[date])))

if use the table(sales in above example) in place of the date table, then you need to add additional conditions

 

Hi there, I currently am using the following measure:

 
Inv. Running =
Var First = [Unrestricted to Use]

VAR LastVisibleDate =
MAX ( 'Date Table'[Date] )
VAR FirstVisibleDate =
MIN ( 'Date Table'[Date] )
VAR LastDateWithSales =
CALCULATE (
MAX ( 'Ready To Ship'[Customer Requirement Date] ),
REMOVEFILTERS ()
)
VAR Result =
First +
IF (
FirstVisibleDate <= LastDateWithSales,
CALCULATE (
[Orders to Ship] ,
'Date Table'[Date] <= LastVisibleDate
)
)
RETURN
Result
 
This is only getting me the correct values at the total level for the columns. Not through the values, as shown in my images. 
I do have a date table and it is being used as the columns in the matrix. 

 

mdhenzel
Frequent Visitor

To Add, for July, it would be 16 - 15 for 11, - 25 for -14 and so on. If not possible, do we know why the measure is working in this way?

 

mdhenzel_0-1656515415632.png

 

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.