Forum Discussion

SLJN's avatar
SLJN
Regular Visitor
3 years ago

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

    • SLJN's avatar
      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.