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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello everyone,
What DAX formula i can use the same with the one I'm using in Tableau calculations. Please see example for my tableau calculation:
IF CONTAINS([ColumnsA], "Apples")
OR CONTAINS([Column A], "Orange")
THEN "Fruits"
ELSEIF
IF CONTAINS([ColumnsA], "Spinach")
OR CONTAINS([Column A], "Potato")
THEN "Vegetables"
ELSE "Herbs" END
Your help would be appreciated. Thank you
Solved! Go to Solution.
Hi @Jedahn,
You can use below DAX expression to create a column in a table:
Column = If(CONTAINSSTRING('Sample'[Column A], "Apples") || CONTAINSSTRING('Sample'[Column A], "Orange") , "Fruits",
IF(CONTAINSSTRING('Sample'[Column A], "Spinach") || CONTAINSSTRING('Sample'[Column A], "Potato") ,"Vegetables","Herbs"))
Please refer to the below screenshot,
If this answer helps, please mark it as Accepted Solution so it would help others to find the solution.
Thanks!
Inogic Professional Service Division
An expert technical extension for your techno-functional business needs
Power Platform/Dynamics 365 CRM
Drop an email at crm@inogic.com
Service: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/
Hi @Jedahn,
Yes, "Sample" is a Table name in the Power BI report. Please find reference screenshot of the Power Query for Table :
Thanks!
Inogic Professional Service Division
An expert technical extension for your techno-functional business needs
Power Platform/Dynamics 365 CRM
Drop an email at crm@inogic.com
Service: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/
NewColumn=SWITCH(TRUE(),Table[ColumnA] IN {"Apples","Orange"},"Fruits",Table[ColumnA] IN {"Spinach","Potato"},"Fruits","Herbs")
Hi @Jedahn,
You can use below DAX expression to create a column in a table:
Column = If(CONTAINSSTRING('Sample'[Column A], "Apples") || CONTAINSSTRING('Sample'[Column A], "Orange") , "Fruits",
IF(CONTAINSSTRING('Sample'[Column A], "Spinach") || CONTAINSSTRING('Sample'[Column A], "Potato") ,"Vegetables","Herbs"))
Please refer to the below screenshot,
If this answer helps, please mark it as Accepted Solution so it would help others to find the solution.
Thanks!
Inogic Professional Service Division
An expert technical extension for your techno-functional business needs
Power Platform/Dynamics 365 CRM
Drop an email at crm@inogic.com
Service: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/
Thank you for the reply. What does the 'Sample' in formula means? Is it the Table name or column name?
Hi @Jedahn,
Yes, "Sample" is a Table name in the Power BI report. Please find reference screenshot of the Power Query for Table :
Thanks!
Inogic Professional Service Division
An expert technical extension for your techno-functional business needs
Power Platform/Dynamics 365 CRM
Drop an email at crm@inogic.com
Service: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/
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!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 35 | |
| 31 | |
| 20 | |
| 13 | |
| 10 |