Forum Discussion

CarsteFoRd's avatar
CarsteFoRd
Regular Visitor
2 years ago
Solved

Return value based on two events in another column

Hi  I could really use som help for uptaining the desired new column from the current data as seen below    Thanks in advance  Carsten   Current data Desired new column Child Pare...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi CarsteFoRd ,

    Based on the information you have provided, you can follow the steps below to solve the problem:

    1.Add columns.

     

    P&C = 
    VAR _1 = 'Table'[Parent] & "|" & 'Table'[Child]
    RETURN
        IF ( 'Table'[Parent] = "Bike", _1, "Bike" & "|" & _1 )
    
    Result = 
    VAR _1 =
        IF (
            CONTAINSSTRING ( 'Table'[P&C], "Wheel" ),
            IF ( CONTAINSSTRING ( 'Table'[P&C], "Bike" ), "yes", "no" ),
            BLANK ()
        )
    VAR _2 =
        IF (
            CONTAINSSTRING ( 'Table'[Parent], "Wheel2" )
                || CONTAINSSTRING ( 'Table'[Child], "Wheel2" ),
            BLANK (),
            "Model 1"
        )
    RETURN
        IF ( _2 = "Model 1", _1, "no" )
    

     

     Final output:

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

    If it does not help, please provide more details with your desired out put and pbix file without privacy information.

     

    Best Regards,

    Ada Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.