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! Learn more

Reply
Anonymous
Not applicable

Remove no of days from Date with DAX

Hi All,


The requirement is i have to remove days(Time) from Date column with DAX(calculated column or measure)
Time Column - Text
Date Column - Date(dd-mm-yy)

Example - if the Time column has 2,00 days,  Date colum (17th Jan 22) = 17th jan 22-3days
the output should come - 15th Jan 22
Any advise please?

LikhithaVG123_0-1672125206521.png

Thanks

1 ACCEPTED SOLUTION

I see, 

the issue is with the format ",00" the most direct way to solve this would be to change the columns data type to number. Here is an dax alternative:

Measure 30 =
var _date = MAX('Table (19)'[Column1])
var _diff = value(max('Table (19)'[Column2]))/100
return

_date-_diff

The 14,00 is converted for example to 1400 with VALUE and this is why your numbers don't match.
ValtteriN_0-1672142325273.png

 








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

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ValtteriN
Super User
Super User

Hi,

You can use e.g. MAX/SELECTEDVALUE combined with a simple subtraction:

ValtteriN_1-1672126370836.png

dax:

Measure 30 =
var _date = MAX('Table (19)'[Column1])
var _diff = MAX('Table (19)'[Column2])
return

_date - _diff

ValtteriN_2-1672126406464.png

 


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/




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

Proud to be a Super User!




Anonymous
Not applicable

Hi @ValtteriN 

Thanks for the solution. But can we convert same measure to calculated column?
beacuse when i am creating Measure . i am getting circular dependency error (if we use combination of more calcu,ated columns and measures their might be circular dependency) to avoid can we convert same measure to calculated column ??

i have tried to convert same into calculated column but it is giving incorrect result

 

Please advise

Anonymous
Not applicable

Hi ValtteriN
I have tried your formula - Getting incorrect result as below screenshot
Pleae advise further.

LikhithaVG123_0-1672140406238.png
Thanks

 

 

I see, 

the issue is with the format ",00" the most direct way to solve this would be to change the columns data type to number. Here is an dax alternative:

Measure 30 =
var _date = MAX('Table (19)'[Column1])
var _diff = value(max('Table (19)'[Column2]))/100
return

_date-_diff

The 14,00 is converted for example to 1400 with VALUE and this is why your numbers don't match.
ValtteriN_0-1672142325273.png

 








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

Proud to be a Super User!




Helpful resources

Announcements
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!

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.