Forum Discussion
Difference between 2 values in a table
- 7 years ago
First, if you want user interaction to influence the calculation, then you cannot use a calculated column, you would need to use a measure. Second, you will need to use slicers that are not related to your table. Easiest way to do that would be to use Create Table from the modeling tab and use:
DISTINCT('Table'[Jusisdiction])Check your relationships view and make sure that they are not related to your main table. Now that you have that, you can then create a measure like:
Measure = VAR __slicer1 = MAX('Slicer1'[Jurisdiction]) VAR __slicer2 = MAX('Slicer2'[Jurisdiction]) VAR __value1 = MAXX(FILTER('Table',[Jurisdiction]=__slicer1),[Mean]) VAR __value2 = MAXX(FILTER('Table',[Jurisdiction]=__slicer2),[Mean]) RETURN __value1 - __value2Something along those lines.
First, if you want user interaction to influence the calculation, then you cannot use a calculated column, you would need to use a measure. Second, you will need to use slicers that are not related to your table. Easiest way to do that would be to use Create Table from the modeling tab and use:
DISTINCT('Table'[Jusisdiction])Check your relationships view and make sure that they are not related to your main table. Now that you have that, you can then create a measure like:
Measure =
VAR __slicer1 = MAX('Slicer1'[Jurisdiction])
VAR __slicer2 = MAX('Slicer2'[Jurisdiction])
VAR __value1 = MAXX(FILTER('Table',[Jurisdiction]=__slicer1),[Mean])
VAR __value2 = MAXX(FILTER('Table',[Jurisdiction]=__slicer2),[Mean])
RETURN
__value1 - __value2Something along those lines.
- Rewind7 years agoHelper I
Thank you! This worked with no issues :)