Forum Discussion
Calculated column for getting ABS Value
Hello,
Can anyone help me with the below scenario. Not able to get get the proper absolute values when doing a difference of values between two columns.
Column A
Column B
Column C
Column D
Coumn E = Column B+Column C+Column D
Column F = Column E - Column A
ABS Column F = ABS(Column E - Column A)
Sample data structure:
| DATE | ET | REC | NAME | RV | RB | Diff |
| 31/09/2019 | NA | CP | MASTER | 1137942.43 | 0 | 0 |
| 31/09/2019 | NA | CP | RE LLC | -5538.88 | 0 | 0 |
| 31/09/2019 | NA | CP | RE LLC | 27503662.9 | 0 | 0 |
| 31/09/2019 | NA | CP | SDL | 649975.71 | 0 | 0 |
| 31/09/2019 | NA | SC | LLC | 0 | 63250000 | 0 |
| 31/09/2019 | BH | SC | RE LLC | -25164.39 | 0 | 0 |
If i create a measure the values are coming as expected but not with a calculated column. I cant use a measure because i have to use calculated column in a matrix which has the show data points as a table option, which only appears if i use a calculated column.
So please help me how should i write a calculated column to get the correct abs values.
I tried to even do something like IF <0 THEN *-1 ELSE *1 on column F but it is not giving the proper results, my data is very granular i.e many transactions for a customer and i am not able to figure out how the results are computed at calculated column level to tweek the code
Appreciate if someone can help me with this
Thanks!
3 Replies
- HashamNiazSolution Sage
Hi Anonymous !
Please share some sample data so we can work with the example. Also please share te DAX formula you are using for measure. You might use use the same DAX to create new column.Regards,
Hasham
- AnonymousNot applicable
Hi Anonymous,
Can you please share some dummy data with a similar data structure and expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
- AnonymousNot applicable
Hi Anonymous,
Any update on your requirement?
BTW, if you want to achieve a custom summary in calculated columns, you may need to manually add filters to calculate and summarize records with partial row and column category fields.
Clever Hierarchy Handling in DAX - SQLBI
Regards,
Xiaoxin Sheng