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

Counting Escalation ID where Type is "Executive" and is in the last year

Hi all,

 

I have this in the DAX column but can't get it to work.

Test = CALCULATE(COUNT(Escalation[Id]),DATESINPERIOD(Escalation[Created Date],TODAY(),-1,YEAR), Escalation[Type] = "Support Manager")

Am I missing something? It's not filtering correctly for the Type

 

Getting error saying "A date column containing duplicate dates was specified in the call to function 'DATESINPERIOD'. This is not supported.

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Based on my test, You should create Calendartable using the formula. Then create relationship between dimtime and Escalation based on date column.

dimtime = CALENDARAUTO()

Then your formula should work well. 

 

Test1 = CALCULATE(COUNT(Escalation[Id]),DATESINPERIOD(dimtime[Date],TODAY(),-1,YEAR), Escalation[Type] = "Support Manager")

Capture.PNG

 

For more details, please check the pbix as attched.

 

https://www.dropbox.com/s/bunja64n7j994q9/Counting%20Escalation%20ID.pbix?dl=0

 

Regards,

Frank

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Based on my test, You should create Calendartable using the formula. Then create relationship between dimtime and Escalation based on date column.

dimtime = CALENDARAUTO()

Then your formula should work well. 

 

Test1 = CALCULATE(COUNT(Escalation[Id]),DATESINPERIOD(dimtime[Date],TODAY(),-1,YEAR), Escalation[Type] = "Support Manager")

Capture.PNG

 

For more details, please check the pbix as attched.

 

https://www.dropbox.com/s/bunja64n7j994q9/Counting%20Escalation%20ID.pbix?dl=0

 

Regards,

Frank

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @Anonymous,

 

Does that make sense? If so, kindly mark my answer as a solution to close the case.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

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.