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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
NidhiBhusari
Helper IV
Helper IV

Difference between two date values that are in text format.

Hello,

I have two rows having year values named as START YEAR and END YEAR. But these values are in text format. Can anybody please help me in calculating difference between these two values.

startYearendYear
20172020
20012010
2018\N
20132020
20012006
2011\N
20172019
20092009
20032019
20122020
2021\N
2016\N
1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@NidhiBhusari 

you can create a column.

Column = if('Table (2)'[endYear]="\N",blank(),int('Table (2)'[endYear])-'Table (2)'[startYear])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
ryan_mayu
Super User
Super User

@NidhiBhusari 

you can create a column.

Column = if('Table (2)'[endYear]="\N",blank(),int('Table (2)'[endYear])-'Table (2)'[startYear])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu can you share the sample file in which you have implemented the scenario?

@NidhiBhusari 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hey @ryan_mayu Thanks for the solution...its working.

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@NidhiBhusari , In power query you have the option to clean the data, use that that will remove \N (return),

 

Then change the data type to text and try.

Under data tranform -(power query) -> Tranform tab -> clean

 

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
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.