Forum Discussion

Truelearner's avatar
Truelearner
Icon for Helper III rankHelper III
6 years ago
Solved

grouping data for custom category

Hi ALL, i have data of an emp login who works for multiple clients , employee logs hours he worked for each client he worked for and i have summaried the total hours employee worked on a day in a column "Hours per day" ,  Now i want to bin the data  like the second table , 0-7 hours as one bin , 7-9 hours as one bin , above 9 hours as one bin , can someone please help  

 

Empclient DatehoursHourrs per day
1A5/15/202013.5
1B5/15/20201.53.5
1C5/15/202013.5
1D5/16/2020410
1E5/16/2020610
2A5/15/2020611
2B5/15/2020211
2C5/15/2020311
2D5/16/202019
2E5/16/202089

 

 

 

Emp10 to 77 to 9Above 9
1101
2011

 

@v-chuncz-msft @amitchandak @v-wxu@mgwena @cham @cham @amitchandak @Greg_Deckler @Mariusz @Mariusz @yij @yij v-yingj@ v-diye-msft@ @v-eachen-msft @v-juanli-msft @v-jayw-msf @v-zhenbw-msft  @harshnathani

 

  • dax's avatar
    dax
    6 years ago

    Hi  Truelearner , 

    You could try below measure and refer to my sample for details.

    Measure 2 = COUNTX(SUMMARIZE('Table (2)','Table (2)'[Emp],'Table (2)'[Date],'Table (2)'[status]),'Table (2)'[status])+0

     

    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

7 Replies

  • Truelearner add a new column for the bin

     

    Bin = 
    SWITCH ( TRUE(),
     Table[Columns] > 9, "More than 9 hours"
     Table[Columns] > 7, "7 - 9",
     "0-7"
    )
    

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

    • Truelearner's avatar
      Truelearner
      Icon for Helper III rankHelper III

      if i create a column that column will reference the total hours in a day and the count associated with the duplicated depending on the number of line items that employee have on that day . 

       
       
       

      • dax's avatar
        dax
        Icon for Community Support rankCommunity Support

        Hi Truelearner , 

        You could refer to my sample for details.

        Best Regards,
        Zoe Zhi

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • parry2k's avatar
      parry2k
      Icon for Super User rankSuper User

      Truelearner can you share pbix file with sample data and expected output and I will look at it. My solution answered the original question you posted but seems like there is more than that.