Forum Discussion
Using Range Bins as Legend Categories
Hello, I am trying to use ranges that I've created from a nother calculated field. I am taking a distinct count of certain categories and then I've created a range out of this distinct count:
4 Replies
- TheoCCommunity Champion
Hi thrillhouse
Can you create a calculated column as follows:
Column =
SWITCH (
TRUE () ,
[Main Categories Count] < 3 , "0-2" ,
[Main Categories Count] < 5 , "2-4" ,
"5+" )Hope this helps.
Theo
- thrillhouseHelper I
Thanks, Theo. I tried this as well, however, this also only display "0-2" as the only values even though that is not the case. This column doesn't display the correct values when in a table either. The IF statement I pasted above shows the correct values in a table, but doesn't seem to work as a legend.
- TheoCCommunity Champion
thrillhouse then it's related to the measure that you referenced. Use the following measure and it will fix the issue:
Measure =
VAR _1 = COUNTROWS ( 'Table' )
RETURN
SWITCH (
TRUE () ,
_1 < 3 , "0-2" ,
_1 < 5 , "2-4" ,
"5+" )Hope this helps.
Theo
- v-angzheng-msftCommunity Support
Hi, thrillhouse
Could you please consider sharing more details about it and posting expected result so it is clear on what needs to be implemented? And It would be great if there is a sample file without any sesentive information here.
It makes it easier to give you a solution.
- Sample (dummy dataset) data as text, use the table tool in the editing bar
- Expected output from sample data
- Explanation in words of how to get from 1. to 2.
Best Regards,
Community Support Team _ Zeon ZhengIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.