Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Thanks for any assistance. In the data, we have a date table, and a table with the columns production date, item, amount and expiration date. My request is for creating a measure that calculate the current amount for any item at any given date (considering that production of any item happens more than once), as an alternative to creating the snapshot by etl.
Thanks for the support
Solved! Go to Solution.
Hi @Lenastray
if I understand you correct you can try to create a measure in your date table like
Measure =
var _currentDate = MAX('DateTable'[Date])
RETURN
CALCULATE(SUM(Table[Amount]), Table[production date] <= _currentDate, Table[expiration date] >= _currentDate)
Put your day column from the dates table into the visual that you want to use, and then create a measure that calculates the amount of products for each day where the production date is in the past and the expiration date is in the future.
Show some sample data and expected result.
Hi @Lenastray
if I understand you correct you can try to create a measure in your date table like
Measure =
var _currentDate = MAX('DateTable'[Date])
RETURN
CALCULATE(SUM(Table[Amount]), Table[production date] <= _currentDate, Table[expiration date] >= _currentDate)
Works great. Thanks! Az38. Which filter is recommended in calculate if we want to have the inventory for every day independent if there is a production of some item or not.
Did you get resolution to this follow up question? I have the same question.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
12 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
18 |