Forum Discussion

OH's avatar
OH
Regular Visitor
8 years ago
Solved

easy way to categorize data based on ranges

I am quite new to PowerBI and all the big data mining stuff. Yet since some weeks I am trying to ramp my knowledge up.   When typing the subject I looked up all the proposes articles but non was t...
  • v-danhe-msft's avatar
    8 years ago

    Hi OH,

    Based on my test, you could refer to below steps:

    Sample data:

    Create a calculated column:

    Type = IF('Table1'[Value]<=0.1,1,
             IF('Table1'[Value]<=0.2,2,
             IF('Table1'[Value]<=0.5,3,
             IF('Table1'[Value]<=1,4))))

    IF you want to adapt to the other column, just modify the column name in the formula(see the [Value] changed to the [Length]).

    Type2 = IF('Table1'[Length]<=0.1,1,
             IF('Table1'[Length]<=0.2,2,
             IF('Table1'[Length]<=0.5,3,
             IF('Table1'[Length]<=1,4))))

    You can also download the PBIX file to have a view.

    https://www.dropbox.com/s/vhcq8xr3p64fodm/easy%20way%20to%20categorize%20data%20based%20on%20ranges.pbix?dl=0

     

    Regards,

    Daniel He