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

counter to display the number of days since the last event in a list

 

Hello, I am trying to create a counter to display the number of days since the last event in a list (industrial accident for example) and that this be dynamic depending on the choice of the OU or team selected. What the counter should display according to the attached example: Without filter: 1 day (last event on 01/21) Filter on UO2: 12 days (last event on 01/10) Filter on Team2-1: 20 days (last event on 02/01) Any idea on how to go about it? Many thanks in advance.

image (1).png

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Create a measure like this and try

datediff(diffmaxx(allselected(Table), Table[Date]), today(), day)

View solution in original post

HotChilli
Super User
Super User

Write a measure to get the MAX 'Date de l'evenment' - put it on a card

 

This will respond to your filter or slicer.

 

Test it. See that it works.

 

Write a 2nd measure - Assign the  current day (UTCTODAY or NOW()) to a variable

Assign the 1st measure to a variable.

Using DATEDIFF, subtract the 2nd variable from the 1st variable.

 

Put it on a card

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

Write a measure to get the MAX 'Date de l'evenment' - put it on a card

 

This will respond to your filter or slicer.

 

Test it. See that it works.

 

Write a 2nd measure - Assign the  current day (UTCTODAY or NOW()) to a variable

Assign the 1st measure to a variable.

Using DATEDIFF, subtract the 2nd variable from the 1st variable.

 

Put it on a card

amitchandak
Super User
Super User

@Anonymous , Create a measure like this and try

datediff(diffmaxx(allselected(Table), Table[Date]), today(), day)

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.