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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors