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!View all the Fabric Data Days sessions on demand. View schedule
Hi,
I need help to customize a shape map.
I have a shape map on which I calculate on each territory a measure called "Value".
Then for each territory, I calculate a rank according to the result of "Value", using a new measure "Rank".
Finally, I color the map with the "Rank" measure (the best territories are in dark).
My problem is that I want to color the map using a fixed legend, based on a measure 'Rank', to present the territories in 5 groups: "1ère", "De 2 à 5", "De 6 à 9", "De 10 à 13", "De 14 à 15". But when I try that, I lose the color gradient.
I've tried this with a legend stored in a table "Legend", or with a measure like :
I read the following topic on a similar subject :
but I don't understand the rule of the Measure :
Measure =
VAR _t =
ADDCOLUMNS (
DISTINCT ( SELECTCOLUMNS ( 'Sheet1', "dis", 'Sheet1'[DISTRICT] ) ),
"L", 'Sheet1'[Legend]
)
RETURN
CALCULATE ( [Stool_adeq.], FILTER ( _t, [L] = MAX ( 'Legend'[Type] ) ) )
Is it possible to add a legend based on a measure on a shape map ?
Thanks for any help
Hi @v-yangliu-msft ,
Did you manage to download my example, and do you have any idea what solution I could implement ?
Thanks for your help.
Hi @QLB ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous
yon can find a sample of my pbix on : https://1drv.ms/u/s!An-kgXpI-CYEcX-X_fVBnTI7sLw?e=FSHoHN
Thanks for your help !
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!