Forum Discussion

potatodog123's avatar
potatodog123
Frequent Visitor
4 years ago
Solved

Power Query: Formatting with special Line Breaks/Delimiter

Hi, I'm trying to import activity logs of a certain application to visualize errors. The logs are not very data-analytics friendly. It is essentially a text file thats formatted like this: 05/15/2...
  • v-luwang-msft's avatar
    4 years ago

    Hi potatodog123 ,

    Pls test the below:

    Add index:

    Then use the below dax to create new column:

    test = if(LEFT(test1[Column1],1)=" ",0,test1[Index])
    maxindex = CALCULATE(MAX(test1[Index]),FILTER(ALL(test1),test1[test]<>0&&test1[Index]<=EARLIER(test1[Index])))

    Final create a new table:

    Table = SUMMARIZE (
        'test1',test1[maxindex],
         "newcolumn", CONCATENATEX ( VALUES ( 'test1'[Column1]), [Column1],UNICHAR(10))
    )

    After research, when we add line break in text directly, Power BI always strips line breaks out of text when it gets loaded into the Data Model.So we need to create visual 😞Please review more details about UNICHAR in this blog.)

     


    Best Regards

    Lucien