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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
pbi1908
Helper III
Helper III

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 1
Anonymous
Not applicable

Hi @pbi1908 ,

 

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

 

Best Regards,

Jay

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors