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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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?

Thanks

1 ACCEPTED SOLUTION
Super User

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.

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

Proud to be a Super User!

4 REPLIES 4
Super User

Hi,

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

dax:

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

_date - _diff

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.

Thanks

Super User

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.

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

Proud to be a Super User!

## Helpful resources

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors