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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
supergallager34
Frequent Visitor

Count Distinct Accepted on the latest Date

Hello, 

I have a table where I am trying to count the total number of distinct IDs whose applications have been accepted.

IDApplication StatusLast Accessed
101Accepted8/12/2020
101Accepted8/12/2020
101Denied8/10/2020
105Accepted8/13/2020
109Denied8/13/2020
107Accepted8/13/2020
108Accepted8/12/2020
104Accepted8/12/2013
103Denied8/13/2020
103Denied8/13/2020
105Denied8/12/2020
109Accepted8/12/2020


I know how to do the st Date here but I am trying to know how to pull in the status of the ID and count it based on the latest date.

I am trying to count the number of unique IDs that have been accepted at the most recent date.

1 REPLY 1
amitchandak
Super User
Super User

@supergallager34 , Try a measure like


Measure =
VAR __id = MAX ( 'Table'[ID] )
VAR __date = CALCULATE ( MAX( 'Table'[ Last Accessed] ), ALLSELECTED ( 'Table' ), 'Table'[ID] = __id )
RETURN CALCULATE ( Max ( 'Table'[Last Accessed] ), VALUES ( 'Table'[ID ), 'Table'[ID] = __id, 'Table'[Last Accessed] = __date )

or

Measure =
VAR __id = MAX ( 'Table'[ID] )
VAR __date = CALCULATE ( MAX( 'Table'[ Last Accessed] ), ALLSELECTED ( 'Table' ), 'Table'[ID] = __id )
RETURN CALCULATE ( Max ( 'Table'[Application Status] ), VALUES ( 'Table'[ID ), 'Table'[ID] = __id, 'Table'[Last Accessed] = __date )

 

or

last status = lastnonblankvalue('Table'[Last Accessed] ,Max ( 'Table'[Application Status] ))

take Id and above measure and last accessed date max

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.