Forum Discussion
How to create a values range slicer (not a time range)?
- 10 years ago
Thinking about it now... there's a much simpler solution.
Just edit your query (Get Data) and add a custom column with this formula:Text.From(Number.RoundDown([actual odometer values]/5000,0)*5000/1000) & "K - " & Text.From(((Number.RoundDown([actual odometer values]/5000,0)*5000+5000)/1000)) & "K"
That will give you a table like this and you can simply filter on the new column
You can use the first approach I posted here if the ranges would not always contain 5000 but vary in steps... But otherwise i'D go for this second option. :-)
Thinking about it now... there's a much simpler solution.
Just edit your query (Get Data) and add a custom column with this formula:
Text.From(Number.RoundDown([actual odometer values]/5000,0)*5000/1000) & "K - " & Text.From(((Number.RoundDown([actual odometer values]/5000,0)*5000+5000)/1000)) & "K"
That will give you a table like this and you can simply filter on the new column
You can use the first approach I posted here if the ranges would not always contain 5000 but vary in steps... But otherwise i'D go for this second option. :-)
Wow! That is amazing, it's like magic! :)
What would you call that kind of formula? M Formula? R formula? Still learning and just want to know what you did to make the ranges appear?
Only one other issue now - when I create the slicer for the range values, it is putting them in this order:
0K-5K
100K-105K
105K-110K
10K-15K
110K-115K
etc.
I think I've seen others complain about a similar issue when it comes to month order or date order. I don't know how to fix this though. Does anyone have an idea of how to fix the order of the numbers to be from smallest to largest??
Thank you again!!!
- Anonymous10 years agoNot applicable
Hello, if you want to change the sort, you can add another column with th following formula :
Number.RoundDown([actual odometer values]/5000,0)*5000/1000)
After, with the range column you select the "Sort by Column" feature, and choose the newly create column. As the column is number formatted, it should answer you need.
By the way, don't forget to hide the sorting column from the client if you don't want to see it in your report.
Hope it helps
Sebastien