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.
I'd like to create a measure that computes the stock on hand. But the sum of the stock has meaning only per day. For any selected range of dates, it should only take the sum of the values in the last date in context.
I mean if I select a date, let's say 2023-01-22, I should get the stock for this particular day. But if I select a range like 2022-01-01 to 2022-12-31, it should return the sum of the values only for the last date which is in this case 2022-12-31.
I have two tables:
- Inventory: Warehouse ID, Product ID, Quantity On Hand, Date Key ( format YYYYMMDD)
- Dates: Date Key ( format YYYYMMDD ), Date ( date format)
The two tables are linked by the Date Key column.
I really need help, please.
Solved! Go to Solution.
try like
stock on hand =
VAR _date = MAX(Dates[Date Key])
RETURN
CALCULATE(
SUM(Inventory[Quantity On Hand]),
Dates[Date Key] = _date
)
try like
stock on hand =
VAR _date = MAX(Dates[Date Key])
RETURN
CALCULATE(
SUM(Inventory[Quantity On Hand]),
Dates[Date Key] = _date
)
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 |
---|---|
107 | |
97 | |
75 | |
65 | |
53 |
User | Count |
---|---|
144 | |
103 | |
98 | |
85 | |
64 |