Search code examples
type-conversionpowerbibusiness-intelligencepowerbi-desktop

How to convert a specific text string to today's date in Power BI


I have a table with a column called that contains text. Most of the values are years. However, some have the value "present" to represent groups that are still currently active. I want to convert those values to today's year, and convert the column type to date (specifically year type). I want to avoid creating a new column if possible.

enter image description here


Solution

  • Please see below for the DAX language that worked.

    = Table.ReplaceValue(#"Extracted Year2",null,DateTime.LocalNow() ,Replacer.ReplaceValue,{"Disbanded"})