Forum Discussion
Inventory data help - calculate usage
- Anonymous2 years ago
Hi Georgetimes
For your question, here is the method I provided:
Here's some dummy data
"A"
"B"
Create a measure. Types are grouped, and the calculation rule is that Pickup Date is equal to Date_of_report or DropOff Date is greater than Date_of_report.
Bookings = VAR b_DATE = SELECTEDVALUE('B'[Date_of_report]) RETURN CALCULATE( COUNTROWS('A'), FILTER( ALL('A'), 'A'[Bicycle Type] = MAX('A'[Bicycle Type]) && ('A'[Pickup Date] = b_DATE || 'A'[DropOff Date] = b_DATE) ) )Create a measure to calculate usage.
Usage = DIVIDE([Bookings], SELECTEDVALUE('B'[Number of bicycles in stock]))Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Georgetimes
For your question, here is the method I provided:
Here's some dummy data
"A"
"B"
Create a measure. Types are grouped, and the calculation rule is that Pickup Date is equal to Date_of_report or DropOff Date is greater than Date_of_report.
Bookings =
VAR b_DATE = SELECTEDVALUE('B'[Date_of_report])
RETURN
CALCULATE(
COUNTROWS('A'),
FILTER(
ALL('A'),
'A'[Bicycle Type] = MAX('A'[Bicycle Type])
&&
('A'[Pickup Date] = b_DATE || 'A'[DropOff Date] = b_DATE)
)
)
Create a measure to calculate usage.
Usage = DIVIDE([Bookings], SELECTEDVALUE('B'[Number of bicycles in stock]))
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.