Forum Discussion

motionid's avatar
motionid
New Member
4 years ago
Solved

Create column from another column if row does not contain...

Hi all, Very new to DAX and the Power BI world.   Was wondering if I would write the following where rows are extracted and placed into a new column if the column does NOT equal xxx content. i.e....
  • mohammedadnant's avatar
    4 years ago

    Hi motionid 

     

    You can use Conditional Column in Power Query (pls refer to this video: https://youtu.be/7UgqPhu1rN0)

    in Power Query Editor ribbon --> Add columns --> Conditional Columns

    example:

     #"Added Conditional Column" = Table.AddColumn(#"Sorted Rows", "Custom", each if Text.Contains([Fee Type], "Revenue") then [Fee Type] else if Text.Contains([Fee Type], "RRR") then [Fee Type] else null)

    you will also get a nice dialog box to customize the inputs

     

     

    Thanks & Regards,
    Mohammed Adnan

    Learn Power BI: https://www.youtube.com/c/taik18