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
SkaistePapuskai
New Member

integer numbers for new column calculation

Hi,

I have a small issue: my dataframe contains two columns - OrderedQuantity and DeliveredQuantity which contains decimal and integer values. I need to make a new column like this:

=0 in those rows where OrderedQuantity and DeliveredQuantity has integer values

= OrderedQuantity-DeliveredQuantity where OrderedQuantity and DeliveredQuantity has decimal values.

 

I was thinking about using ROUND() function:

= if [OrderedQuantity]<>ROUND(OrderedQuantity,0) and ... then [OrderedQuantity]-[DeliveredQuantity]

But it is not working. Can someone suggest other solution?

 

Thank you a lot

 

3 REPLIES 3
v-micsh-msft
Microsoft Employee
Microsoft Employee

Hi SkaistePapuskai,

 

I tried the round function and it works, please try the formula when creating the column:

Column = if(value(Sheet1[Sales])<>round(Sheet1[Sales],0)&&value(Sheet1[Sales1])<>round(Sheet1[Sales1],0),

                  Sheet1[Sales]-Sheet1[Sales1],

                   0)

See the result:

6.PNG

If any further help needed, please feel free to post back.

Regards

 

diego_salinas
Advocate I
Advocate I

If you don't need the decimals at all, you can format the data type of your columns to "WHOLE NUMBER".

ankitpatira
Community Champion
Community Champion

@SkaistePapuskai Created calculated column as below,

 

= IF( IFERROR(SEARCH(".",YOUR COLUMN),0) > 0, RESULT IF DECIMAL, RESULT IF INTEGER ) 

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.