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

Divide into groups by time passed since updated

Hi,

 

I want to monitor how long time has passed since the values were updated. Does anyone know if there is a simple way to divide the values into groups based on the time passed. The four groups will be "24 hours ago", "1 week ago", "1 month ago" and "later".

 

You can find the pbix here: https://drive.google.com/file/d/1wjkaEM4wvv-plYSJR-HXdo9QKfRj5P19/view?usp=sharing

 

Julkku_0-1612454338200.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create a new column like

 

New column =
var _days = datediff([update timestamp], today(),day)
return
switch(true(),
_day <=1 , "24 hours Ago",
_day <=7 , "A week ago ",
// Add other
"Way back" //Default
)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thank you for your help 🙂 @mahoneypat @amitchandak 

mahoneypat
Employee
Employee

To convert it to a measure, just wrap [update timestamp] with MAX( ) in @amitchandak 's expression.

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


amitchandak
Super User
Super User

@Anonymous , Create a new column like

 

New column =
var _days = datediff([update timestamp], today(),day)
return
switch(true(),
_day <=1 , "24 hours Ago",
_day <=7 , "A week ago ",
// Add other
"Way back" //Default
)

Anonymous
Not applicable

Hi @amitchandak ,

 

Thanks for your suggestion!

 

Is there a way to do this in a measure?

 

Or if not, can font color defining measures be based on calculated columns?

 

Juls

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.

Top Solution Authors