Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi guys, I am trying to retrieve the most recent QTY On Hand for each product in my inventory but the trouble I am having is that for whatever reason, some of these products can be present on multiple order lines of the same order with the same order date and time making it difficult to calculate the most recent QTY On Hand. Below, is an example of such case. My formula is the following :
Highlighted in Green is the value I want to retrieve but my formula currently retreives 298. But , Based on the time reference (TXTIME) the most recent transaction is 7394480 *TXORD#) focusing on the last line (TXLINE) of that order which is 4.
So essentially my formula needs to take into account order time as well as the very last line number in instances such as these.
Any recomendations ?
Hi @cdawidow
Try this:
LAST INVENTORY VALUE =
VAR X =
CALCULATE (
MAX ( INTRAN00[TXQOH] ),
FILTER (
INTRAN00,
INTRAN00[TXTIME] = MAX ( INTRAN00[TXTIME] )
&& INTRAN00[TXLINE] = MAX ( INTRAN00[TXLINE] )
)
)
RETURN
X
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
11 | |
10 | |
10 | |
10 |
User | Count |
---|---|
18 | |
13 | |
12 | |
11 | |
8 |