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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.