Forum Discussion

saipawar's avatar
saipawar
Helper IV
5 years ago
Solved

Segment users based on time

Hi, I would like to segment users based on Delivery Time. However, when I run this condition column query, I am ending up with only "Early riser" and none of the other categories.  Is there so...
  • mahoneypat's avatar
    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