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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Blue_Carbon
Frequent Visitor

Error: Expressions that yield variant data-type cannot be used to define calculated columns.

Hi everyone, I've added a formula column to the end of my power pivot data set and I keep getting this error.

The formula I am using is trying to strip PO numbers from a string of text if the PO number column isn't populated with a PO number.

This is the formula: 

Power BI Error.JPG

 

Please could someone help?

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @Blue_Carbon 

 

The error message means that the formula returns results of different data types in a calculated column, which is not allowed. From your formula, I guess your [PO Number] probably returns Number type value while the expression "MID(......)" returns Text type value, so you will get this error. If the PO Number should be a Number value, you can use VALUE function to wrap up the "MID" expression, for example, VALUE(MID(......)). VALUE function converts a text string that represents a number to a number.

 

In addition, can you provide some sample data of the [PO Number] and [Journal Line Description] columns as well as the expected result in the new column? You use several SUBSTITUTE in the formula, I'd like to see if it's possible to simplify it a bit. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

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.

Top Kudoed Authors