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

Subtracting 2 dates D

Hi,

I created a column whereby I subtracted 2 date columns. it works but when I display it in a table or matrix, it duplicates the values.

 

#Test = 1.0*('BI rpt_TelkomOrderStatus'[DeliveryStatusDate] - 'BI rpt_TelkomOrderStatus'[SaleDateTo])
 
Akesh_0-1660741205941.png

 

5 REPLIES 5
v-jingzhang
Community Support
Community Support

Hi @Akesh 

 

A newer PBI Desktop August version (v. 2.108.825.0) was released on 8/17/2022, which has several fixes on issues in the previous version. You could try the latest version and test it again. 

 

In my test with the latest version, I cannot reproduce the problem. If I only add #Test column to a table or a matrix visual, it doesn't have duplicated values there. 

vjingzhang_0-1661146974193.png

 

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

amitchandak
Super User
Super User

@Akesh , Try like

#Test = int('BI rpt_TelkomOrderStatus'[DeliveryStatusDate] - 'BI rpt_TelkomOrderStatus'[SaleDateTo])

 

or

 

#Test = datediff('BI rpt_TelkomOrderStatus'[SaleDateTo], 'BI rpt_TelkomOrderStatus'[DeliveryStatusDate] , day)

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

Tried both options doesn't work

mh2587
Super User
Super User

Try this approach 
DATEDIFF(<Date1>, <Date2>, <Interval>)


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Tried this, Doesnt work

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