Forum Discussion

BachFel's avatar
BachFel
Helper II
8 years ago
Solved

left(Tabelle1[ColumnA]=

IF the first 18 letters (count from left) in column [Apfel] = "Objektbesichtigung" then show result from column[Birne] otherwise Blank()   Anybody who can help with the synthax?
  • shebr's avatar
    8 years ago

    Hi BachFel

     

    You can use the following "IF(LEFT(E0[Apfel], 18) = "Objektbesichtigung", E0[Birne], BLANK())"

     

    Or

     

    This can be done in the Power BI Editor.

     

    1. Go to your editor, duplicate the [Aptel] Column, right click on the column header and click 'Duplicate column'

    2. On the duplicated Column right click  the header and click 'Split Column' - 'By number of characters'

    3. Type in 18, and select 'Once, as far left as possible'. Click OK. See image.

    Note

    The reason for duplicating the column first is so that the original column is not affected. This funuction will split the column, keep the first column and 'delete' the column with the excess letters. Unless you need this of course.

    4. From the menu ribbon, select 'Add Column', and click 'Conditional Column'

    5. Add your criteria here based on the new column that is already split into first 18 chars. See image.

    6. Dont forget to name the column and click OK.

     

    Hope that works, let me know how you get on.

     

    Thanks

     

    shebr

     

     

  • Zubair_Muhammad's avatar
    8 years ago

    BachFel

     

    =
    IF (
        LEFT ( 'LN'[Leistungsbeschreibung], 18 ) = "Objektbesichtigung",
        'LN'[Datum]
    )