Forum Discussion
Segment users based on time
- 5 years ago
It is evaluating each condition separately and all your rows are likely > 5 AM so get marked as early riser. You need to nest yours condition together. In the Formula Bar (turn it on in Options if not visible) modify your step with 'and' in between to look like this.
= Table.AddColumn(#"Changed Type", "Custom", each if [Column1] > #time(5, 0, 0) and [Column1] < #time(10, 0, 0) then "Early Riser" else if [Column1] >= #time(10, 0, 0) and [Column1] < #time(15, 0, 0) then "Lunch Person" else "Other")
Pat
HI saipawar ,
I think you need to give a condition like >= and <= to get something.
In your case you have conditions which have open boundaries as they just look at greater than/less than/etc.
you will have to frame your IF-ELSE with greater-than and less-than conditions for each category.
for example:
IF([column] >= 0 && [column] <= 10, "Value1",
IF([column] >10 && [column] <= 20, "Value2", "Value3"))
You can achieve this by creating a Custom column in Power Query or using DAX to create a calculated column.
Thanks,
Pragati