Forum Discussion
Custom Bin Labels
- Anonymous8 years ago
Anonymous,
There is no built-in option to customize the bin labels. In your scenario, you can add a column using the DAX below, then drag the column into your graph.
Column = IF(Table[columnname (bins)]=0,"0-30", if(Table[columnname (bins)]=30,"30-90",IF(Table[columnname (bins)]=90,"90-990",IF(Table[columnname (bins)]=990,"above 990",IF(Table[columnname (bins)]=120,"120-149", IF(Table[columnname (bins)]=150,"150-170", IF(Table[columnname (bins)],"180-210")))))))
Regards,
Lydia - 8 years ago
Anonymous,
I would use SWITCH() function instead of nested IFs as follows:
NewBinName = SWITCH(
[YourBinName]=0,"0-29"
,[YourBinName]=30,"30-59"
...
,[YourBinName]=180,"180-210"
,"Unknown")However, you don't need to cluster your variable by in-built functionality into category first, when you have to rename it anyway. You can create new column with the category using the SWITCH() function by yourself as follows:
NewCategory = SWITCH(
TRUE(),
[BaseVariableName]<30,"0-29"
,[BaseVariableName]<60,"30-59"
...
,[BaseVariableName]<211,"180-210"
,"")The SWITCH() function prioritizes the conditions according to their order.
Anonymous,
There is no built-in option to customize the bin labels. In your scenario, you can add a column using the DAX below, then drag the column into your graph.
Column = IF(Table[columnname (bins)]=0,"0-30", if(Table[columnname (bins)]=30,"30-90",IF(Table[columnname (bins)]=90,"90-990",IF(Table[columnname (bins)]=990,"above 990",IF(Table[columnname (bins)]=120,"120-149", IF(Table[columnname (bins)]=150,"150-170", IF(Table[columnname (bins)],"180-210")))))))
Regards,
Lydia