Skip to main content
cancel
Showing results for 
Search instead 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

Reply
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 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 @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

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 @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

barritown_0-1695393216673.png

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors