cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JChris
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
malagari
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
malagari
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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Top Solution Authors
Top Kudoed Authors