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
Syndicate_Admin
Administrator
Administrator

Creation of measure according to date

Hello Community, I have a question and I do not know how to make the query, but I will try to be clear ...

I have a table with several columns (management, area, company, description of the action to be performed, status of the share (late, on time, etc.) and the expiration date of the share).

What I need is to generate a measure that allows me to obtain the number of all corrective actions with delayed action status that are more than 15 days late.

How can I do it?

Thank you

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Syndicate_Admin , There should be two days, assume the second date is today. You need a measure

 

Calculate(countrows(Table), filter(Table, Table[Status] = "Late" && Table[expiration date] <Today() -15 ))

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-jayw-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

Something like below:

measure = Calculate(COUNT([ACTION]),FILTER('TABLE',[STATUS]="LATE"&&[DELAYED DATE]>15))

If you don't have the [DELAYED DATE] in the table, you could use DATEDIFF() function to get the day difference between [expiration date] and TODAY() or any given date.

Modify the formula as below:

measure = 
VAR DELAYED DATE = DATEDIFF([expiration date],TODAY(),DAY)
RETURN

Calculate(COUNT([ACTION]),FILTER('TABLE',[STATUS]="LATE"&&[DELAYED DATE]>15))

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

Something like below:

measure = Calculate(COUNT([ACTION]),FILTER('TABLE',[STATUS]="LATE"&&[DELAYED DATE]>15))

If you don't have the [DELAYED DATE] in the table, you could use DATEDIFF() function to get the day difference between [expiration date] and TODAY() or any given date.

Modify the formula as below:

measure = 
VAR DELAYED DATE = DATEDIFF([expiration date],TODAY(),DAY)
RETURN

Calculate(COUNT([ACTION]),FILTER('TABLE',[STATUS]="LATE"&&[DELAYED DATE]>15))

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@Syndicate_Admin , There should be two days, assume the second date is today. You need a measure

 

Calculate(countrows(Table), filter(Table, Table[Status] = "Late" && Table[expiration date] <Today() -15 ))

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.