Forum Discussion
Anonymous
5 years agoNot applicable
Calculate Remaining Items
Hello, Any help in how to do this in Power Bi will be highly appreciated. Given the data below: StartCount = 100 Table1: # Used 1 20 2 30 3 15 4 5 I ...
- 5 years ago
Here is a measure expression to do it. I called your table Used (so you'll need to change that to your actual table name), and I renamed your "#" column to "Num". To get your 2nd measure, just change the return as indicated in the comment.
Rem =
VAR vInitial = 100
VAR vThisNum =
MIN ( Used[Num] )
VAR vUsedSoFar =
CALCULATE (
SUM ( Used[Used] ),
ALL ( Used ),
Used[Num] <= vThisNum
)
RETURN
vInitial - vUsedSoFar
// for Rem % use DIVIDE(vInitial - vUsedSoFar, vInitial)Pat
Anonymous
5 years agoNot applicable
Hi Ashish,
Yes I do have date col as well, I wanted to keep it simple for the test case.
Ashish_Mathur
Super User
5 years agoThat date column would have made the measure simpler but if you already have a solution, it is fine.