cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## Subtracting the result of a selection in visual 1 from a measure in visual 2

Background:

I receive information from a color scanning machine, determining whether the perceived color matches the color that it is intended to be. The difference in color is represented by a number and calculated as a simple AVERAGE([deviation amount]).

Request:

The goal is to be able to select a color in visual 1 and have the AVERAGE([deviation amount]) be subtracted from all the values in table 1.

For clarification, please see the image below, which shows the selection in the left visual and the result of that selection in two cards.

The value named 'selected measure' should be subtracted from the values in the table on the right.

Depiction of the report

Problem:

As soon as the measure result is inserted in the table, the filter context of the table kicks in and the measure is divided over the colors, making the result of the [selected value] - AVERAGE([deviation amount]) = 0 for every row.

Any help would be appreciated! 😘

1 ACCEPTED SOLUTION
Super User

Hi @Anonymous,

I'd create a full copy of your original table with the help of this line:

``Data Copy = Data``

Then I'd use the original for the bar chart visual on the left and the copy for the table on the right.

Once this dashboard is ready, the measure below will do the trick:

``````Difference =
VAR CurrentValue = MIN ( 'Data Copy'[Selected] )
VAR ExtractionValue = AVERAGE ( Data[Selected] )
RETURN CurrentValue - ExtractionValue``````

Best Regards,

Alexander

Super User

Hi @Anonymous,

I'd create a full copy of your original table with the help of this line:

``Data Copy = Data``

Then I'd use the original for the bar chart visual on the left and the copy for the table on the right.

Once this dashboard is ready, the measure below will do the trick:

``````Difference =
VAR CurrentValue = MIN ( 'Data Copy'[Selected] )
VAR ExtractionValue = AVERAGE ( Data[Selected] )
RETURN CurrentValue - ExtractionValue``````

Best Regards,

Alexander