Forum Discussion

pbi1908's avatar
pbi1908
Icon for Helper III rankHelper III
3 years ago

Legend in a shape map based on a Value

Hi i have a Shape map with countries, in Legend i have the TYPE (Customer or Supplier), and i have a Switch measure in the color saturation. 

 

My measures are following:

 

SUM_SUPPLIER = CALCULATE(SUM(QUANTITY), TYPE = "SUUPLIER")
SUM_CUSTOMER= CALCULATE(SUM(QUANTITY), TYPE = "CUSTOMER")

SWITCH_C_S = 
VAR GREATER = IF(SUM_CUSTOMER>SUM_SUPPLIER,SUM_CUSTOMER,SUM_SUPPLIER)
RETURN
SWITCH(TRUE()
MAX(TYPE) = "CUSTOMER", SUM_CUSTOMER,
MAX(TYPE) = "SUPPLIER", SUM_SUPPLIER,
GREATER)

 

I also have a slicer in which i have the TYPE (CUSTOMER/SUPPLIER). 

 

What i want is where nothing is selected in the slicer to see in a country the greatest value (if supplier qty is greater than customer i want to see the this and vice versa) and the country green if is a supplier country and blue if it's a customer country. 

 

In some cases i see the correct result but in some others no and i cannot understand why. 

 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi pbi1908 ,

     

    Need some sample data to test the formula. Please share it in text format.

     

    Best Regards,

    Jay