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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Filled Map by regions by value

Hi, I am trying to create a filled map that color goes from darker blue to lighter blue depends on the regions' sales number, eg MD/PA/VA are Region1, ND/SD/MT are region2, region1 has higher sales number than region2, so the color on MD/PA/VA will be shaded in the same darker blue color while ND/SD/MT are shaded in the same lighter blue color.  I have the state, region, and sales column in the table.  When i create the map with state and sales, it shows correctly but only on state level.  as soon as I add the region, it stopped reflecting sales value, only showing regions with default color.  I have tried to use color fx under legend but no luck.  How do i fix this?  thanks in advance!

 

2 ACCEPTED SOLUTIONS

Hi,

Hope you are using Filled Map Visual. In such case, there is a option to conditionally format the colors in the map. You should be using the Sales Revenue measure to conditionally format the map visual. Color Scales or Divergent Colour ... you can choose as per your need

 

PFB link the shows the step by step implementation of conditional formatting that would avoid setting the colors manually for all regions

 

https://thewindata.com/power-bi-desktop-filled-maps-with-conditional-formatting/

 

Hope this helps!!

If this is what you are expecting, mark this as an answer!!!

 

View solution in original post

@Anonymous  Please paste your sample data in table format in future as it makes it easier for us to build you a sample file like the one attached below signature.

 

You need to build a DAX measure that calculates the Sales per region, and use that in your map formatting: 

 

Sales All States Current Region =
VAR _Region = SELECTEDVALUE(Sales[Region])
RETURN
CALCULATE(
[Total Sales]
, ALL(Sales[State]), Sales[Region] = _Region
)

 

AllisonKennedy_0-1629368187681.png

 

 

AllisonKennedy_1-1629368301973.png

 

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

7 REPLIES 7
Thejeswar
Super User
Super User

@Anonymous ,

Can you share a sample PBIX file?

Anonymous
Not applicable

Hi @Thejeswar  Please see the screenshots below.  to simplify, I only inluded few states in R1 and R2.  The real data would be for the entire 50states. 

sample Dataset

chriscg28_0-1629342130269.png

 

I created a new measure [Total sale per region]

as you can see, in the table, it shows total sale per region, but I am having a difficult time to reflect this in the map -- R1 should have darker blue color while R2 sould have lighter blue color, but I don't see where I can set that.  Since the real data will have more regions and more states, I don't want to manually set this in Data colors, hope there is a function I can use.  Thanks much!  

Christine

chriscg28_1-1629342186802.pngchriscg28_2-1629342211425.png

 

@Anonymous  Please paste your sample data in table format in future as it makes it easier for us to build you a sample file like the one attached below signature.

 

You need to build a DAX measure that calculates the Sales per region, and use that in your map formatting: 

 

Sales All States Current Region =
VAR _Region = SELECTEDVALUE(Sales[Region])
RETURN
CALCULATE(
[Total Sales]
, ALL(Sales[State]), Sales[Region] = _Region
)

 

AllisonKennedy_0-1629368187681.png

 

 

AllisonKennedy_1-1629368301973.png

 

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Hi @AllisonKennedy this is very helpful!  after seeing your DAX, i realized my sales by region measure was wrong.  thank you so much!

Hi,

Hope you are using Filled Map Visual. In such case, there is a option to conditionally format the colors in the map. You should be using the Sales Revenue measure to conditionally format the map visual. Color Scales or Divergent Colour ... you can choose as per your need

 

PFB link the shows the step by step implementation of conditional formatting that would avoid setting the colors manually for all regions

 

https://thewindata.com/power-bi-desktop-filled-maps-with-conditional-formatting/

 

Hope this helps!!

If this is what you are expecting, mark this as an answer!!!

 

AllisonKennedy
Super User
Super User

@Anonymous It sounds like you don't need State in your map at all in this case - only region in location. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

If I take the state out, PBI wouldn't know what regions are since they are customized regions.  the map will just show completely blank. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.