Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi I'm trying to use a map to show the sales by State. I have this...
Of course all State have different amount od sales. I would like show it by range, something like that for the legend:
Thanks in advance...
Solved! Go to Solution.
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
Hi @dsilveira. Just in case if you do not like the nested IFs , 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
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
when i use the expression it throw an error stating multiple aruguments are not allowed
Hi @dsilveira. Just in case if you do not like the nested IFs , 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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |