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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.