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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Create a collumn that calculates the difference between a specific date and today

Hello!

I have a visualization table that has the name and date of an error. Besides that, there is also another important data, the Status, it tells you if this case/error is closed, open, in progress, etc.

This specific error is still in open holding to be resolved. I want to calculate the difference between today and the creation day to know the time it been opened. To get this result I need to create another column that calculates that difference.

In this table I need to create the column that makes the calculation and returns how many days past since the error was opened but only using the data of the errors that own the status opened, and since my date is in the format of DD:MM:YYYY HH:MM:SS I would like to know if there is any way I can hide the time and just show the date. I know is possible to split it in Query Editor but that would malfunction in all the other visualizations I used. 

 

Unfortunately my company rules won't let me post the real data but I'll try to replicate an example.

 

 

 

 

Prata_Jose_0-1653577940447.png

 

The Number column indicates the error name, the created show us when it happened and the awaiting is the measure I used to sort the date. This measure display only the opened  errors.

Also if possible i wanted to hide that awaiting column or even substitute it with other relevant value. 

 

 

Prata_Jose_1-1653578071364.png

This is the measure.

 

 

 

Hope this helps the "investigations", if anything else is required don't hesitate to contact me. 

 

Regards.

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , You can hide time using format. But that means time stamp is still there.

 

Better to have a new column in dax

 

= Datevalue([Datetime])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try the measure.

 

Datediff = 
CALCULATE (
    DATEDIFF ( MAX ( 'Page 1'[Created] ), TODAY (), DAY ),
    FILTER ( 'Page 1', 'Page 1'[Status] = "Awaiting" )
)

vkkfmsft_0-1653975937013.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try the measure.

 

Datediff = 
CALCULATE (
    DATEDIFF ( MAX ( 'Page 1'[Created] ), TODAY (), DAY ),
    FILTER ( 'Page 1', 'Page 1'[Status] = "Awaiting" )
)

vkkfmsft_0-1653975937013.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , You can hide time using format. But that means time stamp is still there.

 

Better to have a new column in dax

 

= Datevalue([Datetime])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.