Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Get sprint number from date

Hi, I'm new to Power BI.

I have a table with a column called "Due date." I am trying to create a new column: sprintNumber, where if due date between A&B then  sprintNumber=1, if due date between B&C then  sprintNumber=2 and so on and so forth.

How could I do that in PowerBI desktop?

Thanks in advance!

3 Replies

  • Anonymous , You can create a new column like

     

    switch( True(),

    [Due Date] >= date(2020,1,31)  && [Due Date] < date(2020,3,31)  , 1 ,

    [Due Date] >= date(2020,3,31)  && [Due Date] < date(2020,5,31)  , 2 ,

    // Add other

    )

     

    You can also do based on another date

    switch( True(),

    [Due Date] >= [Start Date] && [Due Date] < c   +15 , 1 ,

    [Due Date] >=  [Start Date] +15  && [Due Date] <  [Start Date] +30  , 2 ,

    // Add other

    )

  • Anonymous  Can you share some sample data by copy paste it over here or share in Excel? 

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    May I ask if your problem has been solved? Did amitchandak's post above help you? If any of the posts are helpful, then please consider accepting it as a solution to help other members find it faster. Many thanks!

     

    If this doesn't work for you, would you mind providing some data that does not contain private information?

    It makes it easier to give you a solution.

    1. Sample (dummy dataset) data as text, use the table tool in the editing bar
    2. Expected output from sample data
    3. Explanation in words of how to get from 1. to 2.

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data