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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, it's the first time that I post. I am quite new at Power Bi.
I have been trying to understant how to use the CONTAINS function. I do the same thing as the video does but I keep getting the same result for every line. I m trying to get true if the column A =1 and if the column B = 2, if not --> false
So I wrote:
Solved! Go to Solution.
Hi @Anonymous ,
If you use calculate column, the Contains() function is for all data in each column.
For example:
As long as there is one row in the data of the two columns [PRIX A] and [PRIX B] that satisfies the conditions of [PRIX A]=1&&[PRIX B]=2, the whole calculated column will all display True, if not satisfied, all will display False.
If Measure is used and it is a table visual table, each row is equivalent to a data table, so at this time there is only this row of data in the data table.
For example:
[PRIX A]=1,[PRIX B]=2, it is equivalent to an independent table, this table also has only this row of data, and it is True if it meets the conditions
[PRIX A]=2,[PRIX B]=2, this row is also equivalent to an independent table, but if it does not meet the conditions, it is False.
https://towardsdatascience.com/power-bi-calculated-measures-vs-calculated-columns-9be012e9bff1
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
If you use calculate column, the Contains() function is for all data in each column.
For example:
As long as there is one row in the data of the two columns [PRIX A] and [PRIX B] that satisfies the conditions of [PRIX A]=1&&[PRIX B]=2, the whole calculated column will all display True, if not satisfied, all will display False.
If Measure is used and it is a table visual table, each row is equivalent to a data table, so at this time there is only this row of data in the data table.
For example:
[PRIX A]=1,[PRIX B]=2, it is equivalent to an independent table, this table also has only this row of data, and it is True if it meets the conditions
[PRIX A]=2,[PRIX B]=2, this row is also equivalent to an independent table, but if it does not meet the conditions, it is False.
https://towardsdatascience.com/power-bi-calculated-measures-vs-calculated-columns-9be012e9bff1
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you,
But then does that mean that we can't use CONTAINS in a calculated column?
@Anonymous, Follow above measure suggestion using CONTAINS else try with IF ELSE using calculated column:
@Anonymous Create a measure to get the result. Refer the below screen shot:
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!