Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Generating random dates between a time frame

Hi all,

I have a dummy dataset that does not have a date column, Is there a way of generating random dates between a time frame in Power BI?

  • Hi Anonymous ,

     

    According to your description, here is my solution.

    You can create a calculated column by using RANDBETWEEN function.

    I made a sample for you to reference.

     

    Column = RANDBETWEEN(DATE(2022,10,1),DATE(2022,11,20))

     

    Final output:

    Remember that the data type of the "column" should be "DATE" or "DATE/TIME".

     

    Best Regards,
    Community Support Team _ xiaosun

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

1 Reply

  • v-xiaosun-msft's avatar
    v-xiaosun-msft
    Community Support

    Hi Anonymous ,

     

    According to your description, here is my solution.

    You can create a calculated column by using RANDBETWEEN function.

    I made a sample for you to reference.

     

    Column = RANDBETWEEN(DATE(2022,10,1),DATE(2022,11,20))

     

    Final output:

    Remember that the data type of the "column" should be "DATE" or "DATE/TIME".

     

    Best Regards,
    Community Support Team _ xiaosun

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