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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Count number of ID with Specific Latest Status

Hey Datanauts,

 

I have a table which record the timestamp and change in status of each id as shown below:

 

Ticket_IDEdit_DatetimeChange_Status
0011/5/2020 12:00New
0011/6/2020 12:00Approved
0011/7/2020 12:00Investigating
0011/7/2020 14:00Closed
0021/6/2020 12:00New
0021/7/2020 13:00Approved
0021/7/2020 16:00Escalated
0021/9/2020 08:00Closed

 

I am trying to count the number of IDs based on thier latest status. For example, if i set the max date slicer to 1/8/2020, I hope to get the following result.

 

Count of TicketChange_Status
1Escalated
1Closed

 

So far I was able to extract the latest status with the following formula but cant get it to count the number of DCR:

Ticket_IDEdit_DatetimeChange_Status
0011/7/2020 14:00Closed
0021/7/2020 16:00Escalated
Latest Status = 
var Max_Date= CALCULATE(MAX('Table'[Edit_Datetime]),FILTER(ALLSELECTED('Table'),'Table'[Ticket_ID]=MAX('Table'[Ticket_ID]))) return
CALCULATE(MAX('Table'[Change_Status]), FILTER('Table','Table'[Edit_Datetime] = Max_Date))

 

1 REPLY 1
az38
Community Champion
Community Champion

Hi @Anonymous 

try COUNTROWS() function, like

Latest Status = 
var Max_Date= CALCULATE(MAX('Table'[Edit_Datetime]);FILTER(ALLSELECTED('Table');'Table'[Ticket_ID]=MAX('Table'[Ticket_ID]))) 
return
CALCULATE(COUNTROWS('Table'); FILTER('Table';'Table'[Edit_Datetime] = Max_Date))

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

 

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.