Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

select the opposite of the chosen in a slicers

Good morning. I have two boards.

Table Products.

LotProductAmount
1grape juice10
2apple juice23
3apple juice43

Ingredients Table

LotProductAmount
1grape juice5
1grape juice5
1Water2
1Sugar1
1Water4
1nectar de uva3
2apple juice10
2apple juice13
2Water10
2Sugar3
2Water5
2apple nectar5
3apple juice22
3apple juice21
3Water13
3Sugar5
3Water20
3apple nectar8

These two tables are related by the batch field. I'd like to see in a pie visualization the decomposition of a product. I choose this product from a slicer with the product field in the products table. The problem I have is that in the ingredients table also comes the product in addition to the ingredients in which it is broken down. I wondered if you can think of any filtering in the pie visualization that all products (in the ingredients table) appear except the one that matches the name of the product selected in the slicer with the product field (from the products table). Thanks for the help.

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

It’s my pleasure to answer for you.

According to your description,I think you can create a measure to calculate the desired result.

Like this:

Measure = IF(SELECTEDVALUE(Ingredients[Product])in DISTINCT(Products[Product]),0,1)

8.png 

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

It’s my pleasure to answer for you.

According to your description,I think you can create a measure to calculate the desired result.

Like this:

Measure = IF(SELECTEDVALUE(Ingredients[Product])in DISTINCT(Products[Product]),0,1)

8.png 

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mahoneypat
Employee
Employee

A few ways to do this.  One would be to do it in a measure, but a simple way might be to make a column on your second table with this formula, and then use it as a visual or page filter in the Filter Panel.

 

Include = IF(Ingredients[Product] = RELATED(Products[Product]), "N", "Y")

 

This assumes you have a 1:Many between the tables.

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Please confirm you are putting a DAX calculated column (not a measure) on the Ingredients table with the formula, and that you have a 1:Many relationship between the Products and Ingredients table. If so, the RELATED should pull the product value for that batch to the ingredients table for the comparison to the product value on that row of the ingredients table.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thank you for your answer @mahoneypat I am I have put the column you mention but I get error in putting:

Nueva_Columna-IF(Ingredients[Product] - RELATED(Products[Product]), "N", "Y")

the Products[Product] part tells me: The 'Products[Product]' column does not exist or has no relation to the tables available in the current context.

I tried to put only the column without the name but it tells me: The RELATED function expects a full column reference as an argument.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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