Brotedo
Brotedo

Reputation: 3

Date (Month/Year) Based on Number in another Column

I have a column in powerbi that repeats the numbers 1-12, and I would like another column to display a date (month and year) based on that number, such that 1 always corresponds to the current month/year, two would be next month, etc. like this:

Index | Date 1 | July 2022 2 | August 2022 3 | September 2022

and on August 1, it would change to:

Index | Date 1 | August 2022 2 | September 2022 3 | October 2022

Upvotes: 0

Views: 178

Answers (1)

Peter
Peter

Reputation: 12375

You can use this formula in a calculated column:

Date 1 = 
FORMAT( 
    DATE( 
        YEAR(NOW()), 
        MONTH(NOW()) + 'Table'[Index], 
        1
    ), 
    "mmmm yyyy"
)

Upvotes: 0

Related Questions