Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am trying to perform a subtraction of the same name value but in different columns. Also the name of the column is decided by a slicer. Is there a DAX measure equation to do this? So I want to subtract average of TRP performance factor of the CT40 from the average TRP performance factor of the TC25.
Thanks
Solved! Go to Solution.
Hi @zebra123
Does all data come from the same table? Does the field in the slicer come from that table? Assume that all data is in the same table and that the expected result should be put in the same matrix, you can try below code to create a measure. Modify table and column names per your need. In my sample, "c" is the fixed one to be subtracted from.
Difference =
var _minuend = CALCULATE(AVERAGE('Table (2)'[Factor1]),ALLSELECTED('Table (2)'[Type]),'Table (2)'[Type] = "c")
var _subtrahend = AVERAGE('Table (2)'[Factor1])
return
_minuend - _subtrahend
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Yes, I'm showing the data in a matrix visual.
The data is stored in a table, but the data I need to compare is in the matrix.
Hi @zebra123
Does all data come from the same table? Does the field in the slicer come from that table? Assume that all data is in the same table and that the expected result should be put in the same matrix, you can try below code to create a measure. Modify table and column names per your need. In my sample, "c" is the fixed one to be subtracted from.
Difference =
var _minuend = CALCULATE(AVERAGE('Table (2)'[Factor1]),ALLSELECTED('Table (2)'[Type]),'Table (2)'[Type] = "c")
var _subtrahend = AVERAGE('Table (2)'[Factor1])
return
_minuend - _subtrahend
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi,
Not sure if I understood you correct, but is this what you want?:
SUMX( 'Table', 'Table'[Column1] - 'Table'[Column2] )
Br
Marius
The data is in a matrix so I dont think that would work
But what you are talking about now is the visual? You show data in a matrix visual, or?
The table you having the data stored (fact table), how does that look like?
Marius 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
96 | |
79 | |
67 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |