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
SophRow
Resolver II
Resolver II

Filter a measure to remove duplicates from another column

Hi,

I've created the following measure:

 

Total Queries on AE Form = CALCULATE(COUNTROWS('Query Metrics'),'Query Metrics'[Visit]="Adverse Event") + 0
 
And what I want to do is filter it by a different column ('Participant') so that I remove any duplicates i.e., all i want to know if the % of unique participants in a trial who have a query on the AE form.
 
SophRow_0-1674289945878.png

 This is a snip of the data - in this example I'd only want a count of 1 for participant 022-004 if i was interested in queries on the Screening A1 form for example.

 

Thanks!

Soph

1 REPLY 1
FreemanZ
Super User
Super User

hi @SophRow 

are you expecting a table with the Participant columnn and a measure like this:

 

Percent = 
VAR TotalAE = 
CALCULATE(
    COUNTROWS('Query Metrics'),
    'Query Metrics'[Visit]="Adverse Event"
+ 0
VAR AllAE = 
CALCULATE(
    COUNTROWS('Query Metrics'),
    FILTER(
        ALL('Query Metrics'),
        'Query Metrics'[Visit]="Adverse Event"
    )
)  + 0
RETURN
DIVIDE(TotalAE, AllAE)

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.