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
Naresh91
Employee
Employee

Count the Open Account Numbers per each category with latest date

Hi ,

 

i have the below Table

AccIDCategoryAccStatusDate
ab133xyzOpen1/1/2020
ab133abcOpen1/1/2020
ab133cdeOpen1/1/2020
ab133efzClosed1/1/2020
cd354xyzOpen1/6/2020
cd354abcClosed1/2/2020
dc566cdeOpen1/3/2020
gf345xyzOpen1/4/2020

 

i want to calculate "AccID" who have the "AccStatus" as "Open" for each "Category" with Latest Date.

 

 

it has to count the Highlighted Rows

 
AccIDCategoryAccStatusDate
ab133xyzOpen1/1/2020
ab133abcOpen1/1/2020
ab133cdeOpen1/1/2020
ab133xyzClosed1/2/2020
ab133efzClosed1/1/2020
cd354xyzOpen1/2/2020
cd354abcClosed1/6/2020
dc566cdeOpen1/3/2020
gf345xyzOpen1/4/2020
gf345xyzClosed1/1/2020

 

 

1 REPLY 1
amitchandak
Super User
Super User

@Naresh91 ,

if this measure >0 , the you need to color the column as green using conditional formatting 

new Count =
VAR __id = MAX ('Table'[AccID] )
VAR __date = CALCULATE ( MAX('Table'[Date] ), ALLSELECTED ('Table' ), 'Table'[AccID] = __id , 'Table'[AccStatus] = "Open")
CALCULATE ( Count ('Table'[Date] ), VALUES ('Table'[AccID] ),'Table'[AccID] = __id,'Table'[Date] = __date , 'Table'[AccStatus] = "Open" )+0

 

 

max open date 

new Date =
VAR __id = MAX ('Table'[AccID] )
VAR __date = CALCULATE ( MAX('Table'[Date] ), ALLSELECTED ('Table' ), 'Table'[AccID] = __id , 'Table'[AccStatus] = "Open")
CALCULATE ( Max ('Table'[Date] ), VALUES ('Table'[AccID] ),'Table'[AccID] = __id,'Table'[Date] = __date , 'Table'[AccStatus] = "Open" )

 

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.

Top Solution Authors