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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
maracles
Resolver II
Resolver II

Column data type locked to Date

I have three tables.

1. Order Facts with a date column called First Published. This stores a date and Power BI, as expected, allows me to change the format on the modelling tab to whatever I want e.g. Whole Number.

2. Work Records with a date column called First AssignedThis stores a date and Power BI, as expected, allows me to change the format on the modelling tab to whatever I want e.g. Whole Number.

3. A link table called Unique Work Records. This is a two column table with all the unique work records by OrderID. This column is then used to link to the other two tables. The second column is First Assigned and is produced using a RELATED() function to extract the MIN([First Assigned]). Again, this stores a date and Power BI, as expected, allows me to change the format on the modelling tab to whatever I want e.g. Whole Number.

I have then created three measures:

 

 

  • First Assigned Date Max = MAX(Order Facts[First Assigned Date])

  • First Published Date Max = Max(Unique Work Records[First Published Date]

  • Time to Delegation = [First Published Date Max] - [First Assigned Date Max]


My goal is to have this final measure give the number of days between the other two dates and it does seem to work however it will only return the value as a date. When I go to the modelling ta for that measure I cannot select a different data type so I cannot show it as a whole number i.e. the number of days.

Can anyone help?

Thanks. 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

Try adding a "*1" to your formula for the final measure and see if that helps:

 

Time to Delegation = ([First Published Date Max] - [First Assigned Date Max]) * 1

Or use DATEDIFF with an interval of DAYS:

https://msdn.microsoft.com/en-us/library/dn802538.aspx

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

Try adding a "*1" to your formula for the final measure and see if that helps:

 

Time to Delegation = ([First Published Date Max] - [First Assigned Date Max]) * 1

Or use DATEDIFF with an interval of DAYS:

https://msdn.microsoft.com/en-us/library/dn802538.aspx

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler the "*1"  worked great. If you dn't mind, why does that work?

Thank you. 

Forces it to be returned as a number instead of a date type, basically in DAX data type logic: 

Date - Date = Date 

whereas 

Date * Number = Number


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Very useful. Thanks. 

Forces it to be returned as a number instead of a date type, basically in DAX data type logic, Date - Date = Date whereas Date * Number = Number



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors