cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

How to count rows using another related table as filter?

I have two tables that are linked:

 

  1. Software (UniqueID, Name, Vendor)
  2. Status (UniqueID, Status, Description)

 

The link between them is UniqueID. I want to create a Measure where I count the total of rows in Software which the Status.Status is "AUTHORIZED". How can I do that?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver IV
Resolver IV

 

There are a few ways you can do this, depending on how your relationships directions are set up.

 

Option 1

 

MeasureName = 
CALCULATE(
   COUNTROWS(Software),
   FILTER(Software, RELATED(Status[Status]) = "AUTHORIZED)
)

--- OR ---
MeasureNameOptimized = CALCULATE( COUNTROWS( FILTER(Software, RELATED(Status[Status]) = "AUTHORIZED") ) )

 

Option 2

 

 

MeasureName = 
CALCULATE(
   COUNTROWS(Software),
   FILTER(Status, Status[Status] = "AUTHORIZED")
)

 

Dan Malagari
Consultant at Headspring

View solution in original post

1 REPLY 1
Highlighted
Resolver IV
Resolver IV

 

There are a few ways you can do this, depending on how your relationships directions are set up.

 

Option 1

 

MeasureName = 
CALCULATE(
   COUNTROWS(Software),
   FILTER(Software, RELATED(Status[Status]) = "AUTHORIZED)
)

--- OR ---
MeasureNameOptimized = CALCULATE( COUNTROWS( FILTER(Software, RELATED(Status[Status]) = "AUTHORIZED") ) )

 

Option 2

 

 

MeasureName = 
CALCULATE(
   COUNTROWS(Software),
   FILTER(Status, Status[Status] = "AUTHORIZED")
)

 

Dan Malagari
Consultant at Headspring

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors