cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
TinyMouse
Regular Visitor

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 reportDepiction 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
barritown
Super User
Super User

Hi @TinyMouse,

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

barritown_0-1695393216673.png

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

View solution in original post

1 REPLY 1
barritown
Super User
Super User

Hi @TinyMouse,

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

barritown_0-1695393216673.png

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors