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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sdemunshi
New Member

Present grouped data in a filled map - colours not syncing within the group

I have a dataset named Heatmap which is in the shape/structure shared below:

ClusterRegionCountryIndustrySector% CAGR
EMEAMiddle EastQatar   
EMEAMiddle EastOman   
EMEAMiddle EastUAEConsumerPersonal Care12%
EMEAMiddle EastUAEIndustrialAutomotive5%
EMEAMiddle EastUAEHealthPharma6%
APAChina/HKChinaTelecomMedia10%
APAChina/HKHK   
APAUSUSConsumerPersonal Care13%
APAUSUSIndustrialAutomotive6%
APAUSUSHealthPharma16%
APAUSUSTelecomMedia30%
APAUKUKConsumerPersonal Care2%
APAUKUKIndustrialAutomotive65%
APAUKUKHealthPharma11%
APAUKUKTelecomMedia10%

(and so on)

 

My objective is to plot the Region column in a filled map visual, wherein:

1. The colour for Middle East should include, for example, Qatar, Oman and UAE. The colour for China should include China and HK. I have several such 'groups' of countries, where one country serves as a proxy for the concerned region.

2. The colours will be conditioned on the % CAGR column i.e. the higher the figure, the darker the colour and vice-versa.

3. Filters will include: Cluster, Region, Industry and Sector. When any of these filters are used, the map should continue to represent the full region, using the info of the proxy countries. 

4. Average of % CAGR is taken at the region level.

 

I've gotten as far as creating a conditional column:

2019-2022 CAGR (grouped) =
    var AvgME = CALCULATE(AVERAGE(Heatmap[2019-2022 CAGR]),FILTER(Heatmap,Heatmap[SCM region]="United Arab Emirates"))
    var AvgCNHK = CALCULATE(AVERAGE(Heatmap[2019-2022 CAGR]),FILTER(Heatmap,Heatmap[SCM region]="China"))
return
    IF((Heatmap[Territory]="Middle East"&&Heatmap[Industry]=""),AvgME,
        (IF((Heatmap[Territory]="China/HK"&&Heatmap[Industry]=""),AvgCNHK,
    Heatmap[2019-2022 CAGR])))))))

 

And a measure for the map color to support the conditional formatting:

Map Color =
    var AvgCAGR = CALCULATE(AVERAGE(Heatmap[2019-2022 CAGR (grouped)]))
return
    IF(AvgCAGR>=0.10,"#175d2d",
     IF(AND(AvgCAGR<0.10,AvgCAGR>=0.05),"#ffb600",
     IF(AvgCAGR<0.05,"#e0301e","#7d7d7d")))

 

But the 'groups' of countries are not formatted the same colour despite this - does anyone have any idea what I'm doing wrong?

0 REPLIES 0

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors