Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello,
I am a new user. I want to develop the shape map with custom legend. The legend is by range and kindly find the example of my idea below:
Table 1 (Sample)
Area1 | Country | Item | Customer | Amount | More column.... |
A1 | AA | Food | Cus1 | 1000 | |
A3 | DD | Electronic | Cus1 | 10000 | |
A2 | FF | Food | Cus2 | 5000 | |
A1 | BB | Electronic | Cus2 | 3000 | |
A1 | AA | Food | Cus1 | 40000 | |
A1 | BB | Electronic | Cus3 | 50000 | |
More information..... |
- Based on that I created two shape maps by range.
- One is the Customer allocated by Country (maps range eg. distinct count the customer and if the count is
1 - 5 | Red |
5 - 6 | Green |
6 - 10 | Yellow |
Greate than 10 | Orange |
- The second is the amount allocated by country.
Less than 1K | color |
1 K - 10 K | color |
10 K - 100K | color |
100 K - 1000 K | color |
Greater than 1000 K | color |
- I also created the customer range table and the amount range table to sort the legend.
- Slicer by Area (A1, A2,A3, etc), and other column visualization.
Problem
- Create the Range measure for the map and the measure cannot used in the legend. So put the measure to fill color fx.
- Create the custom legend with table from the range legend table..
- How can I link with measure and range legend table. And also the sumx values of amount and distinct count values of cust are dynamic based on the user selection of slicer or other visualization.
Please kindly help me to develop this one.
Solved! Go to Solution.
Hi @Ariel_1 - Legend wise visual colors change automatically conditional formatting will not work out but
I have created supporting tables for range of colors mentioned as below. we will use lookupvalue function as below
First create a calculated table with customerRange:
CustomerRange = DATATABLE(
"Range", STRING,
"Color", STRING,
{
{"1 - 5", "Red"},
{"5 - 6", "Green"},
{"6 - 10", "Yellow"},
{"Greater than 10", "Orange"}
}
)
create another calculated table with for amount
AmountRange = DATATABLE(
"Range", STRING,
"Color", STRING,
{
{"Less than 1K", "Color1"},
{"1K - 10K", "Color2"},
{"10K - 100K", "Color3"},
{"100K - 1000K", "Color4"},
{"Greater than 1000K", "Color5"}
}
)
Hope you already created total amount and count of customers measures at your end to pass the swith condition based on both metrics as below:
CustomerCountRange =
SWITCH(
TRUE(),
[CustomerCount] >= 1 && [CustomerCount] <= 5, "1 - 5",
[CustomerCount] > 5 && [CustomerCount] <= 6, "5 - 6",
[CustomerCount] > 6 && [CustomerCount] <= 10, "6 - 10",
[CustomerCount] > 10, "Greater than 10",
BLANK()
)
create another measure for amount range like customerRange
AmountRange =
SWITCH(
TRUE(),
[TotalAmount] < 1000, "Less than 1K",
[TotalAmount] >= 1000 && [TotalAmount] < 10000, "1K - 10K",
[TotalAmount] >= 10000 && [TotalAmount] < 100000, "10K - 100K",
[TotalAmount] >= 100000 && [TotalAmount] < 1000000, "100K - 1000K",
[TotalAmount] >= 1000000, "Greater than 1000K",
BLANK()
)
create a customer Count Color Measure and similar amount range measure
CustomerCountColor =
LOOKUPVALUE(CustomerRange[Color], CustomerRange[Range], [CustomerCountRange])
i have taken country with states names ,, pass the color
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Hi @Ariel_1 - Legend wise visual colors change automatically conditional formatting will not work out but
I have created supporting tables for range of colors mentioned as below. we will use lookupvalue function as below
First create a calculated table with customerRange:
CustomerRange = DATATABLE(
"Range", STRING,
"Color", STRING,
{
{"1 - 5", "Red"},
{"5 - 6", "Green"},
{"6 - 10", "Yellow"},
{"Greater than 10", "Orange"}
}
)
create another calculated table with for amount
AmountRange = DATATABLE(
"Range", STRING,
"Color", STRING,
{
{"Less than 1K", "Color1"},
{"1K - 10K", "Color2"},
{"10K - 100K", "Color3"},
{"100K - 1000K", "Color4"},
{"Greater than 1000K", "Color5"}
}
)
Hope you already created total amount and count of customers measures at your end to pass the swith condition based on both metrics as below:
CustomerCountRange =
SWITCH(
TRUE(),
[CustomerCount] >= 1 && [CustomerCount] <= 5, "1 - 5",
[CustomerCount] > 5 && [CustomerCount] <= 6, "5 - 6",
[CustomerCount] > 6 && [CustomerCount] <= 10, "6 - 10",
[CustomerCount] > 10, "Greater than 10",
BLANK()
)
create another measure for amount range like customerRange
AmountRange =
SWITCH(
TRUE(),
[TotalAmount] < 1000, "Less than 1K",
[TotalAmount] >= 1000 && [TotalAmount] < 10000, "1K - 10K",
[TotalAmount] >= 10000 && [TotalAmount] < 100000, "10K - 100K",
[TotalAmount] >= 100000 && [TotalAmount] < 1000000, "100K - 1000K",
[TotalAmount] >= 1000000, "Greater than 1000K",
BLANK()
)
create a customer Count Color Measure and similar amount range measure
CustomerCountColor =
LOOKUPVALUE(CustomerRange[Color], CustomerRange[Range], [CustomerCountRange])
i have taken country with states names ,, pass the color
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
User | Count |
---|---|
98 | |
76 | |
75 | |
48 | |
26 |