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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Roy_W
Frequent Visitor

To compare and make a new column of the value with same ID

Hi

I have problem to make a new column value with same ID.

Here is the example of data:

Roy_W_0-1670175920864.png

I need to make a new column to distinguish if "pass/failed/not evaluate" with same ID.

 - If A ever got "passed", then to fill all collums that result="passed" with id=A

 - If B got "failed" and no "passed", then to fill all collums that result="failed" with id=B

 - If someone didn't get "passed" or "failed", then to fill all collums that result="not evaluate" with id=someone

Roy_W_1-1670176525814.png

 

I have attached the pbi file to the question, please kindly help to give some advices, thanks.

file attached 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Roy_W 

Please refer to attched sample file with the solution

1.png

2022 Summary = 
VAR T1 = 
    CALCULATETABLE ( 
        VALUES ( Query1[passed/failed/not evaluate] ), 
        ALLEXCEPT ( Query1, Query1[id] ) 
    )
RETURN
    SWITCH (
        TRUE ( ),
        "passed" IN T1, "passed",
        "failed" IN T1, "failed",
        "not evaluate"
    )

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @Roy_W 

Please refer to attched sample file with the solution

1.png

2022 Summary = 
VAR T1 = 
    CALCULATETABLE ( 
        VALUES ( Query1[passed/failed/not evaluate] ), 
        ALLEXCEPT ( Query1, Query1[id] ) 
    )
RETURN
    SWITCH (
        TRUE ( ),
        "passed" IN T1, "passed",
        "failed" IN T1, "failed",
        "not evaluate"
    )

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.