- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DAX formula to return most recent cost for SKU
Hi,
I am trying to create a measure "Latest Cost" that takes the most recent cost for a SKU based on the Invoice Date.
I am trying to find these values for the sample data below:
ABC123 = $30.20
XYZ123 = $50.20
BBB123 = $30.90
Supplier SKU | Invoice Date | Purchase Unit Price |
ABC123 | 12/22/2022 | $37.95 |
ABC123 | 1/16/2023 | $34.95 |
ABC123 | 11/9/2023 | $30.20 |
XYZ123 | 10/16/2023 | $50.20 |
XYZ123 | 9/29/2023 | $45.20 |
XYZ123 | 8/31/2023 | $65.20 |
BBB123 | 8/25/2023 | $30.90 |
BBB123 | 8/11/2023 | $31.00 |
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adjust the table name in the following DAX Measure:
Follow me on LinkedIn:
https://www.linkedin.com/in/mustafa-ali-70133451/
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LeanAndPractise(Everyday) ) |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Tmk123
Please try
Latest Cost =
SUMX (
VALUES ( 'Table'[Supplier SKU] ),
MAXX (
TOPN ( 1, CALCULATETABLE ( 'Table' ), 'Table'[Invoice Date] ),
'Table'[Purchase Unit Price]
)
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adjust the table name in the following DAX Measure:
Follow me on LinkedIn:
https://www.linkedin.com/in/mustafa-ali-70133451/
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks so much!
Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Microsoft Fabric Community Conference 2025
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
Subject | Author | Posted | |
---|---|---|---|
07-23-2024 06:36 AM | |||
07-31-2024 11:01 AM | |||
05-24-2024 07:29 AM | |||
06-25-2024 09:24 PM | |||
11-28-2023 06:41 AM |
User | Count |
---|---|
21 | |
17 | |
16 | |
7 | |
5 |
User | Count |
---|---|
29 | |
28 | |
20 | |
13 | |
12 |