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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PBINewbie12
Microsoft Employee
Microsoft Employee

Sum of unique rows in one table using variables from a different table

Hello,

 

As my nane implies, I am new to PowerBI, but after some searching, I could not find the answer to this question.   Apologies if it is out there and I missed it!

 

I have a very large dataset that looks something like below. 

 

Requests for Assistance
RequestorDate
Dave2/4/2021
Suzy2/5/2021
Dave2/6/2021
Joe2/7/2021
Bill2/8/2021
Suzy2/9/2021
Tom2/10/2021
Frank2/11/2021
Jolene2/12/2021
Maggie2/13/2021
Suzy2/14/2021
Dave2/15/2021
Kathy2/16/2021

 

I want to be able to calculate the number of unique requests based on a table of VIP's (I don't need to know the quantity for each VIP, just how how many in this table are from VIP's.   That table looks like

 

VIP Requestors
Requestor
Suzy
Frank

 

In this example, the measure should return 4.

 

Appreciate your help in understanding how to do this!

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

There are lots of ways to do this.

 

Here are a couple:

COUNTROWS (
    FILTER ( Requests, Requests[Requestor] IN VALUES ( VIPs[Requestor] ) )
)

 

CALCULATE (
    COUNT ( Requests[Requestor] ),
    TREATAS ( VALUES ( VIPs[Requestor] ), Requests[Requestor] )
)

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

There are lots of ways to do this.

 

Here are a couple:

COUNTROWS (
    FILTER ( Requests, Requests[Requestor] IN VALUES ( VIPs[Requestor] ) )
)

 

CALCULATE (
    COUNT ( Requests[Requestor] ),
    TREATAS ( VALUES ( VIPs[Requestor] ), Requests[Requestor] )
)

That was super helpful Alexis!   Thank you very much.

Whitewater100
Solution Sage
Solution Sage

Hi PBINewbi:

Don't worry, in the beginning all this seems confusing. I have put together an appropriate data model (based on what you wrote) and added supporting tables. The solution is done in both a calculated column and measure.

I will attach file for your review. There's usually more than one way to get to a result.

I hope you can accept as a solution. Thanks..https://drive.google.com/file/d/1i9COJVf8XcwtYkaB6a70RpqA_vhJDQ0z/view?usp=sharing 

 

Whitewater100_0-1653094429030.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.