Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Direct Query: Remove characters from beginning Dax

I'm trying to remove the first 7 characters from a period list to leave the remaing 6 behind e.g. "Period 1 - 2018/19" to just 2018/19.   I'm working with direct query and have created a new column...
  • HotChilli's avatar
    HotChilli
    6 years ago

    Ah, you've lost me there. I don't understand what you're telling me.

     

    This is the simplest I could come up with (not tested on Direct Query)

    ColumnText2 = IF (LEFT(TableX[theColumn],1) IN {"1", "2"} ,
       LEFT ( TableX[theColumn], 7)
    ,
       RIGHT ( TableX[theColumn], 7))

    May I also ask what the source system is because Power Query can do this if the source is SQL Server or a few others?