Forum Discussion
datadax123
2 years agoRegular Visitor
Cumulative Sum - 2 conditions
Hey everyone ! I have done many tests here but can't find any solution, any help is appreciated. I have a complex dashboard but I simplified it here in order to focus on the issue : I hav...
Anonymous
2 years agoNot applicable
Hi datadax123 ,
I would appreciate it if you could give me the expected results, thank you.
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
datadax123
2 years agoRegular Visitor
Hey Anonymous ,
In this example it would be :
| Sales Start | Quantity |
| 0 | |
| 1 | 3 |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | 1 |
| 12 | 2 |
| 13 | |
| 20 | |
| 27 | |
| 34 | |
| 41 | 2 |
- Anonymous2 years agoNot applicable
Hi datadax123 ,
Below is my table1:
Below is my table2:
Below is my table3:
The following DAX might work for you:
Measure = var _sale = SELECTEDVALUE(Sales_Start[Sales Start]) var _val_start = SELECTEDVALUE(Validity_List[Sales start]) var _val_End = SELECTEDVALUE(Validity_List[Sales End]) var _Quan = SELECTEDVALUE(Validity_List[Quantity]) RETURN IF(_sale <= _val_start && _sale > _val_End , _Quan , BLANK())The final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.