Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
CarsteFoRd
Regular Visitor

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 

 

CarsteFoRd_0-1710511154384.png

Thanks in advance 

Carsten

 

Current dataDesired new column
ChildParentType Is parent  part of Model 1
WheelBikeModel 1 Yes
SpokeWheel Yes
Spoke Wheel2 No

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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:

vyifanwmsft_0-1710752070392.png

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.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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:

vyifanwmsft_0-1710752070392.png

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.

Hi Ada 


Thanks, but i have a big data set (1million + rows), is this solution viable to automate without having to manually type in the "wheel" "bike"  etc. ? 

The Best Carsten 

CarsteFoRd
Regular Visitor

Can i anyone please help med with this problem i would be very gratefull 

The best Carsten 

 

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.