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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors