Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
caio_queiroz
Frequent Visitor

Conditional Column with two conditions (text columns) and IF result is a Column, else other colum

Guys

 

i need to create a cond. column based on two other columns conditions, i tried many ways, but powerbi tell me that i cant use the IF for differente data type (Text and numbers)

E.g. IF (Table1[Column1} = "A" && Table1[Coluumn2} = "Brazil", Table1[CostAdjusted, Table1[Cost])

Can you help me?

1 REPLY 1
Fowmy
Super User
Super User

@caio_queiroz 

Please if your column1 and column2 are having text data and have the data type as text.

New Column = 
IF (
    AND( Table1[Column1] = "A" , Table1[Column2] = "Brazil"), 
    Table1[CostAdjusted],
    Table1[Cost]
)

 

You can share your screenshot fo the table where ou are trying to add the column with the error message

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.