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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

DAX and variant data type

Hi,

 

I'm trying to replicate this excel formula in Power BI

=IF([@[Ex Factory Allocated]]="Shipped","Shipped",H2-G2)

 

But when i try and insert a column i get this: 

 

Capture2.PNGMy Ex Factory Allocated column is a mixture of text("Shipped) and dates. Also, is there any way to include this in the query editor itself(maybe using the custom column option)? The biggest roadblock here are the different data types for the same column. 

 

Thank you for your help!

 

 

 

 

 

3 REPLIES 3
AkhilAshok
Solution Sage
Solution Sage

You could try using a FORMAT function in the else part:

FORMAT([...Requested]-[...Allocated], "General Number")

 

Anonymous
Not applicable

Hi @AkhilAshok,

 

Thank you for your reply! However, it states that there are too few arguments for the FORMAT function.

Capture3.PNG

Anonymous
Not applicable

Hi @Anonymous ,

I'd like some sample data for test, it will be help for coding formula.
BTW, please check MSDN library for dax format functions, you are typing wrong 'format' expression in 'if' statement.

FORMAT funtion

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors