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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

how to Subtract two column in the PowerBi

HI All,

Kindly help me the below issue, 

where sales1 table is merged table from verify table, So i am trying to subtract the two columns, when i am trying the below formula i have received the error

 

Sudhakar1000_0-1717053531695.png

also i have try the below formula

[OINV.DocTotal]-[OINV.PaidToDate] its taking the text format but i try to change the data type 

 

Sudhakar1000_1-1717053989811.png

i am getting this error. 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Anonymous 

Thanks for the reply from @amitchandak , please allow me to provide addition:

First, make sure that the columns are all numeric data types (e.g., integers, decimal numbers). You can check and change the data type by navigating to Power Query Editor, selecting the columns, and then selecting the correct data type from the drop-down list on the tab. For more details on changing the data type, please refer to the official documentation:

Data types in Power BI Desktop - Power BI | Microsoft Learn


After you confirm that both columns are numeric data types, you can create calculated columns for subtraction. Use the following DAX formula in the new column:

SubtractionResult = [OINV. DocTotal] - [OINV. PaidToDate]

 

Once you've created a calculated column, check it for any errors. If there is an error, it may be due to a null value or a blank value in the column. You may need to handle these situations in the DAX formula.

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @Anonymous 

Thanks for the reply from @amitchandak , please allow me to provide addition:

First, make sure that the columns are all numeric data types (e.g., integers, decimal numbers). You can check and change the data type by navigating to Power Query Editor, selecting the columns, and then selecting the correct data type from the drop-down list on the tab. For more details on changing the data type, please refer to the official documentation:

Data types in Power BI Desktop - Power BI | Microsoft Learn


After you confirm that both columns are numeric data types, you can create calculated columns for subtraction. Use the following DAX formula in the new column:

SubtractionResult = [OINV. DocTotal] - [OINV. PaidToDate]

 

Once you've created a calculated column, check it for any errors. If there is an error, it may be due to a null value or a blank value in the column. You may need to handle these situations in the DAX formula.

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , check the datatype of the columns, Both should be number type

OINV.DocTotal]-[OINV.PaidToDate]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors
Top Kudoed Authors