Forum Discussion
Zkna-M
9 years agoFrequent Visitor
running sum grouped by probablity
I am trying to add a new measure that can calulate cumulative total of value of an item and summarise it on based on probablity. This is the data that I have Item Value Probablity 4 64 ...
- 9 years ago
hi friend
First, Create a new Table (Modeling Enter Data)
2. Related Both Table
3. Create a New Measure
SumValues = CALCULATE ( SUM ( Table1[Value] ), FILTER ( ALLEXCEPT ( Table1; Table1[Item] ), Table1[Probablity] >= MAX ( Probabilities[Probability] ) ) ) + 04. Ready. You can view in a Matrix
Vvelarde
Community Champion
9 years ago
hi friend
First, Create a new Table (Modeling Enter Data)
2. Related Both Table
3. Create a New Measure
SumValues =
CALCULATE (
SUM ( Table1[Value] ),
FILTER (
ALLEXCEPT ( Table1; Table1[Item] ),
Table1[Probablity] >= MAX ( Probabilities[Probability] )
)
)
+ 04. Ready. You can view in a Matrix
- Zkna-M9 years agoFrequent Visitor
I tried but it is not working for me. I must be missing something.
This is the measure that I have:
SumValue = CALCULATE( SUM('Item'[Value]), FILTER( ALLEXCEPT('Item','Item'[Item]), 'Item'[Probability] <= MAX(Probablities[Probability]) ) ) + 0And this the matrix that I get:
What am I missing?
- v-sihou-msft9 years ago
Microsoft Employee
It should be "greater than" (>=) the custom porbability in filter context:
SumValue = CALCULATE( SUM('Item'[Value]), FILTER( ALLEXCEPT('Item','Item'[Item]), 'Item'[Probability] >= MAX(Probablities[Probability]) ) ) + 0Regards,
- Zkna-M9 years agoFrequent Visitor
Sorry. my mistake. I tried changing the sign and doing again but it wasn't working.
Then I created everything from the scratch again and now it is working.
Thank you so much!