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
SLJN
Regular Visitor

Return certain values in column based on a selected column from another table

Hi, 

 

I'm trying to return certain values in a column based on a selected business unit. 

 

The business units have several products, but its only certain products and their weight that I'm interested of. 

 

Firstly, I have created a measure for each unit and their products and weights. 

 

Production (SOUTH) =
CALCULATE (
    [WEIGHT(KG)],
   KEEPFILTERS(DIM_BU[Buid] = "SOUTH"),
   KEEPFILTERS(DIM_PRODUCT[PRODUCT] IN {"Banana","Apple","Pear"})
)
 
Then I have created a SWITCH
 
Production Switch =
 VAR BU = SELECTEDVALUE((DIM_BU[Buid]])

 Return
    SWITCH(
        True(),
        BU= "SOUTH", [Production (SOUTH)],
...) 
 
In my report I have a slicer for the BU but i also want a slicer that only displays the selected product of the chosen BU, for all BU. 
 
So if I chose BU south in the slicer I only want the selected products for that BU to appear in the products slicer.
 
How do I do this? 
2 REPLIES 2
vicky_
Super User
Super User

If there is a relationship between BU and Products (e.g. they are in the same table or there is a bi-directional relationship between their tables), check to see that visual interactions is enabled between the two slicers. 
https://learn.microsoft.com/en-us/power-bi/create-reports/service-reports-visual-interactions?tabs=p...

Or you can use a BU > Product heirarchy and just hiding the specific BU / products that you aren't interested in.

SLJN
Regular Visitor

Thank you. 

There is a relationship. 

however there's a lot of BU and they all have specific products that I'm interested in. This solution is dependent on me editing, I'm looking for a more scalable solution.

 

I want the user to be able to change BU and only get the products specified for that specific BU in another slicer. 

 

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.