Forum Discussion
Bin Naming Output
- Anonymous5 years ago
Hi matsahiro ,
So you should want the effect of dynamic selection.
Here's my workaround.
1.Create two what-if parameters.
2.Create a measure.
Bin Number = VAR maxbinnum = SELECTEDVALUE ( 'Bin Range'[Bin Range] ) VAR maxrev = SELECTEDVALUE ( 'Revenue Range'[Revenue Range] ) * 1000 VAR interval = DIVIDE ( maxrev, maxbinnum ) RETURN ROUNDUP ( DIVIDE ( MAX ( 'Table'[Revenue] ), interval ), 0 )You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi matsahiro
Not entirely clear. You mention Distribution but don't say how this affects your calculations.
Is this what you need to create a new column?
Bin = SWITCH(
TRUE(),
'Table'[Revenue] < 10000, 1,
'Table'[Revenue] < 20000, 2,
'Table'[Revenue] < 30000, 3,
'Table'[Revenue] < 40000, 4,
'Table'[Revenue] < 50000, 5,
'Table'[Revenue] < 60000, 6,
'Table'[Revenue] < 70000, 7,
'Table'[Revenue] < 80000, 8,
'Table'[Revenue] < 90000, 9,
10
)
Regards
Phil
- matsahiro5 years agoHelper II
Hello Phil, thanks for the reply! The data is constantly changing, meaning the bin sizes will be different each time the data refreshes. Revenue could be 0 to 100k one day and 0 to 200k the next day. I want to make sure that I always have 20 bins in the visual that are labeled 1-20 even with the bin sizes changing. The reason I cannot use switch in that way is that the bin sizing will change.