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
joshua1990
Post Prodigy
Post Prodigy

COUNTROWS FILTER MAX AND STRING

Hello everybody!

 

I need to calculate the number of rows where the max row of column "State" has the value "Mount" in column "Process".

 

So, the table has the following structure

OrderDateStateProcess
10001.01.201950Drilling
10001.01.201960Mount

 

My actual approach is the following:

=CALCULATE(COUNTROWS(table1);FILTER(table1;table1[Process]="Mount");FILTER(table1;table1[State]=....

1 REPLY 1
az38
Community Champion
Community Champion

Hi @joshua1990 

try a measure

Measure = 
var _maxState = calculate(MAX('Table'[State]);ALL('Table'[State]))
RETURN
CALCULATE(COUNTROWS('Table');ALL('Table');'Table'[State]=_maxState;'Table'[Process]="Mount")

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

LinkedIn


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

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