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

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

Reply
Anonymous
Not applicable

need help in Lookup function

Hi All,

I have data like below table 

Screenshot_7.png

I want to create "Is Predicted" Filed based on the below condition by using M query 

  • If "Actual value" is present in "Possible value" then yes else No

Screenshot_8.png

 

Sample data:

IDActual ValuePossible ValueIs Predicted
ID1ABYes
ID1AAYes
ID1ACYes
ID2EBNo
ID2EANo
ID2ECNo
ID3CBYes
ID3CAYes
ID3CCYes
1 ACCEPTED SOLUTION

@Anonymous 

 

As a custom column, you can use

"Changed Type" is just the previous step's name. You have to change it according to your last step in the Query Editor

 

=let myID=[ID] in
let mylist=Table.SelectRows(#"Changed Type",each [ID]=myID)[Possible Value]
in
if List.Contains(mylist,[Actual Value]) then "Yes" else "No"

PQy.png

View solution in original post

3 REPLIES 3
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous 

You may create a calculated column with DAX as below:

Column = 
VAR a =
    CALCULATETABLE (
        VALUES ( 'Table'[Possible Value] ),
        ALLEXCEPT ( 'Table', 'Table'[ID] )
    )
RETURN
    IF ( 'Table'[Actual Value] IN a, "Yes", "No" )

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks, 

 

Is it possible in M query editor? 

@Anonymous 

 

As a custom column, you can use

"Changed Type" is just the previous step's name. You have to change it according to your last step in the Query Editor

 

=let myID=[ID] in
let mylist=Table.SelectRows(#"Changed Type",each [ID]=myID)[Possible Value]
in
if List.Contains(mylist,[Actual Value]) then "Yes" else "No"

PQy.png

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.