cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper III

## Calculate inventory value at the end of last year

Hi

I need a measure to calculate the inventory value at the end of last year which is 1,416,839. Please help. Thank you.

1 ACCEPTED SOLUTION
Community Support

Hi @hongyuliu ,

Check the measure.

``````measure =
var _end_of_last_year = calculate(max([date]),filter(all(table),year([date])=year(today())-1))
return
calculate(sum([value]),filter(table,[date] = _end_of_last_year))``````

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
3 REPLIES 3
Community Support

Hi @hongyuliu ,

Check the measure.

``````measure =
var _end_of_last_year = calculate(max([date]),filter(all(table),year([date])=year(today())-1))
return
calculate(sum([value]),filter(table,[date] = _end_of_last_year))``````

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Community Champion

Hi @hongyuliu ,

Is the picture a representation of what your data looks like or how you want the outcome to look?

Br,
J

Solution Sage

Hi @hongyuliu ,

You can create something like this measure:

Inventory Value LY =
var MaxDate = CALCULATE(MAX('Table'[Date]),YEAR('Table'[Date])=YEAR(TODAY())-1)
var InventoryValue = CALCULATE(SUM('Table'[Inventory Value]),'Table'[Date]=MaxDate)
Return
InventoryValue

If I answered your question, please mark it as a solution to help other members find it more quickly.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.