Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
 
					
				
		
Hi All,
I have data like below table
I want to create "Is Predicted" Filed based on the below condition by using M query
Sample data:
| ID | Actual Value | Possible Value | Is Predicted | 
| ID1 | A | B | Yes | 
| ID1 | A | A | Yes | 
| ID1 | A | C | Yes | 
| ID2 | E | B | No | 
| ID2 | E | A | No | 
| ID2 | E | C | No | 
| ID3 | C | B | Yes | 
| ID3 | C | A | Yes | 
| ID3 | C | C | Yes | 
Solved! Go to 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"
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" )
Regards,
@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"
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 80 | |
| 49 | |
| 35 | |
| 31 | |
| 30 |