Forum Discussion

Beginner101's avatar
Beginner101
Regular Visitor
1 year ago
Solved

Need Assistance Converting a column

I'm fairly new to PowerBi.     I have a PowerBi dashboard that I was able to create in 2024.  I am in the process of adding and updating my pbi to reflect 2025 data. I have a column called "Date Re...
  • bhanu_gautam's avatar
    1 year ago

    Beginner101 In the Power Query Editor, go to the "Add Column" tab and click on "Custom Column".

    = if Text.StartsWith([Date Replaced], "Pre-2024") then "Pre-2024"
    else Date.ToText(Date.FromText([Date Replaced]), "MM/yy")

     

    Ensure that the dates in the "Date Replaced" column are in a recognizable date format. If they are not, you might need to transform them into a date format first using Date.FromText.

    After adding the custom column, click on "Close & Apply" to apply the changes and return to the Power BI Desktop and use it as slicer