cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

legend on map with range of data

Hi I'm trying to use a map to show the sales by State. I have this...

map.JPG

Of course all State have different amount od sales. I would like show it by range, something like that for the legend:

legend.JPG

Thanks in advance...

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: legend on map with range of data

Hi @dsilveira,

 

Based on your description, you want to use the data range as the legend, right?
If as I said, you can add a calculate column to calculate the range of the value, then drag it to the “Legend” property in a Filled map visual.


Dax formula:

 

Value Range = 
if(Sheet1[Amount]<=4000,"0~4000",
                if(AND(Sheet1[Amount]>4000,Sheet1[Amount]<=8000),"4000~8000",
                                if(AND(Sheet1[Amount]>8000,Sheet1[Amount]<=12000),"8000~12000",
                                                if(AND(Sheet1[Amount]>12000,Sheet1[Amount]<=16000),"12000~16000",
                                                                if(AND(Sheet1[Amount]>16000,Sheet1[Amount]<=20000),"16000~20000",                           
                                                                                if(AND(Sheet1[Amount]>20000,Sheet1[Amount]<=24000),"20000~24000",
                                                                                                if(AND(Sheet1[Amount]>24000,Sheet1[Amount]<=28000),"24000~28000",
                                                                                                                if(AND(Sheet1[Amount]>32000,Sheet1[Amount]<=36000),"32000~36000",
                                                                                                                                if(AND(Sheet1[Amount]>36000,Sheet1[Amount]<=40000),"36000~40000","40000+")))))))))

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Solution Supplier
Solution Supplier

Re: legend on map with range of data

Hi @dsilveira. Just in case if you do not like the nested IFs Smiley Happy, you can use this DAX syntax. It is much more clear to read and to edit.

 

RANGES = SWITCH(TRUE();AND([Measure]>=0;[Measure]<10);"0 to 9";AND([Measure]>=10;[Measure]<20);"10 to 19";[Measure]>=20;"20 and more")

 

Regards.

Pavel

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: legend on map with range of data

Hi @dsilveira,

 

Based on your description, you want to use the data range as the legend, right?
If as I said, you can add a calculate column to calculate the range of the value, then drag it to the “Legend” property in a Filled map visual.


Dax formula:

 

Value Range = 
if(Sheet1[Amount]<=4000,"0~4000",
                if(AND(Sheet1[Amount]>4000,Sheet1[Amount]<=8000),"4000~8000",
                                if(AND(Sheet1[Amount]>8000,Sheet1[Amount]<=12000),"8000~12000",
                                                if(AND(Sheet1[Amount]>12000,Sheet1[Amount]<=16000),"12000~16000",
                                                                if(AND(Sheet1[Amount]>16000,Sheet1[Amount]<=20000),"16000~20000",                           
                                                                                if(AND(Sheet1[Amount]>20000,Sheet1[Amount]<=24000),"20000~24000",
                                                                                                if(AND(Sheet1[Amount]>24000,Sheet1[Amount]<=28000),"24000~28000",
                                                                                                                if(AND(Sheet1[Amount]>32000,Sheet1[Amount]<=36000),"32000~36000",
                                                                                                                                if(AND(Sheet1[Amount]>36000,Sheet1[Amount]<=40000),"36000~40000","40000+")))))))))

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Advocate I
Advocate I

Re: legend on map with range of data

Thanks @v-shex-msft!

Highlighted
Solution Supplier
Solution Supplier

Re: legend on map with range of data

Hi @dsilveira. Just in case if you do not like the nested IFs Smiley Happy, you can use this DAX syntax. It is much more clear to read and to edit.

 

RANGES = SWITCH(TRUE();AND([Measure]>=0;[Measure]<10);"0 to 9";AND([Measure]>=10;[Measure]<20);"10 to 19";[Measure]>=20;"20 and more")

 

Regards.

Pavel

View solution in original post

Highlighted
Regular Visitor

Re: legend on map with range of data

when i use the expression it throw an error stating multiple aruguments are not allowed 

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors