Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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"
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |