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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Converting value to a date

Hi there,

 

In Excel I have A1 = 10/03/2019 and B1 I did =Value(A1) and I got 43741 as a number

Also In A2 = 43741 and I format it to a date and I got 10/03/2019

Is there any way to do it in DAX? conver number to a date and date to a value.

 

I'm also looking for converting week number to last SAT date of that week like week 40 = 10/05/2019

 

Thanks,

Oded Dror 

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

I think it is better to create a date table. Then create some columns you want(number,weeknum...). You can convert numbers to the correct date against the date table by this way.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

I think it is better to create a date table. Then create some columns you want(number,weeknum...). You can convert numbers to the correct date against the date table by this way.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Well, I think it's technically possible but that does not mean you should do it. Why you want do it?

Regarding finding the next saturday, it depends on your model, but if you have a Date dimension (called DimDate) with a "date" column, i would add a custom column with the formula

NextSat=DateDim[date]+
  -- this will return 1 if Sunday to 7 if saturday. So if it's already saturday add 0, otherwise add difference
   7-WEEKDAY(DateDim[date],1)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.