Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
Adjust the table name in the following DAX Measure:
Proud to be a Super User!
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
Thank you!!
Hi @Tmk123
Please try
Latest Cost =
SUMX (
VALUES ( 'Table'[Supplier SKU] ),
MAXX (
TOPN ( 1, CALCULATETABLE ( 'Table' ), 'Table'[Invoice Date] ),
'Table'[Purchase Unit Price]
)
)
Adjust the table name in the following DAX Measure:
Proud to be a Super User!
Thanks so much!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 8 | |
| 6 | |
| 6 |
| User | Count |
|---|---|
| 24 | |
| 20 | |
| 20 | |
| 14 | |
| 14 |