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,
As the title indicate, I am looking for solutions for creating a custom column using an IF statement based on whether the value of that column matches any values in the providing list.
In SQL, the query is something like:
SELECT count( case when column_a in (101, 133, 150, 168, 199, 323, 456, 888, 999) then 1 else 0)
The screenshot is a simplified approach to describe my question. Please advise how to approach this goal in adding custom column windows. Thank you in advance!
Solved! Go to Solution.
Try usinig List.Contains like this instead.
= if List.Contains({30,40,50}, [age]) then 1 else 0
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@mahoneypat gave a good M version of this.
If you happen to want to do this DAX instead, it would look like this:
IF ( [age] IN { 30, 40, 50 }, 1, 0 )
Try usinig List.Contains like this instead.
= if List.Contains({30,40,50}, [age]) then 1 else 0
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
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.