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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
russd
New Member

Future aging inventory balances

I have two table. One is a Date table and the other is a STOCK table. The STOCK table contains lines of inventory and has three columns, Part Number, Receive Date, and Value. I joined the Receive Date to the Date field in the Date table. I want to create a matrix visual that I can put the Part Number in the Rows, Year/Month in the columns, and a value measure that sums all inventory lines that are over 36 months old within the months displayed over the columns. In the example below, I have a STOCK line of Pipe, based on it's receive date, will be over 36 months old in April 2023 and I have additional lines of Pipe in the STOCK table that will be over 36 months old in Dec 2023. I have a few lines of Paper, that total $12 in value, all over 36 months as of Jan 2023. I have a line of Notebook that will be over 36 months starting in March 2023 and no other lines of Notebook that will turn over 36 months for the rest of the year.

 

Part Number  |  Jan 2023 | Feb 2023 | March 2023 | April 2023| ......| Dec 2023|

Pipe                         0                 0               0                $36                   $120

Paper                      $12             $12           $12             $12                    $12

Notebook                0                  0             $20             $20                   $20

 

What I'm trying to accomplish to project my over 36 month inventory values over future months. If I don't sell a single thing for the rest of the year, how much over 36 month inventory will I have for each future month.

1 ACCEPTED SOLUTION
Martin_D
Super User
Super User

Hi russd,

this measure should make your day:

Aging Stock Amt. > 3m = 
VAR _ReceiveDatesUpTo = 
    CALCULATE (
        MAX ( 'Date'[Date] ),
        DATEADD ( 'Date'[Date], -3, month )
    )
RETURN
    CALCULATE (
        SUM ( 'STOCK'[Value] ),
        'Date'[Date] <= _ReceiveDatesUpTo,
	    ALL ( 'Date' )
    )

The first CALCULATE calculates the last receive date to include.
The second CALCULATE calculates the total received stock value for all past dates up to the last receive date to include.

Download example here

View solution in original post

1 REPLY 1
Martin_D
Super User
Super User

Hi russd,

this measure should make your day:

Aging Stock Amt. > 3m = 
VAR _ReceiveDatesUpTo = 
    CALCULATE (
        MAX ( 'Date'[Date] ),
        DATEADD ( 'Date'[Date], -3, month )
    )
RETURN
    CALCULATE (
        SUM ( 'STOCK'[Value] ),
        'Date'[Date] <= _ReceiveDatesUpTo,
	    ALL ( 'Date' )
    )

The first CALCULATE calculates the last receive date to include.
The second CALCULATE calculates the total received stock value for all past dates up to the last receive date to include.

Download example here

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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