Forum Discussion
Subtracting random rows in a table on a filter condition
I have a table, with following structure. Last column prices Diff is what I would like to extract . The table consists of multiple Source , The prices are captured from Source either in Actual Values or in differential. Source "A" is the base line, Source "B" Price should be reflected as difference from Source "A " e.g. For Month "A" = Month" B" , Price Diff should be , Price "A" - Price "B". prices for Source " C" since already available as differntial should get populated from Price column as is. Is it possible to achieve this using Subtraction function between rows in same table. Thanks fpr your help in advance
| Source | Price | Month | Price Diff |
| A | 32 | Jul-20 | 32 |
| A | 34 | Aug-20 | 34 |
| A | 36.5 | Sep-20 | 36.5 |
| A | 38.3 | Oct-20 | 38.3 |
| B | 33 | Aug-20 | 1 |
| B | 32 | Sep-20 | 4.5 |
| B | 37 | Oct-20 | 1.3 |
| B | 32.5 | Nov-20 | -32.5 |
| C | 0.23 | Jul-20 | 0.23 |
| C | 2.35 | Aug-20 | 2.35 |
| C | -2.34 | Sep-20 | -2.34 |
Hi Anonymous ,
You could refer to my sample for details.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- dax
Community Support
Hi Anonymous ,
You could refer to my sample for details.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi dax, Zoe, Many thanks for your help. It worked just fine.
However, I have a question, I noticed that you used Two Tables . The difference is extracted as a measure in Table (2) , so is there specific reason that you have summarized data in another table Table 2.
This could be too much to ask but if you could explain the measure that you have used. I wonder how you are moving between differnt rows , there isnt a counter used nor an index .
Thanks Again