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
thuhanoi
New Member

Generate a report to calculate number of items that meet multiple criterias

I have a list of participants who attend the different training in different Quarter like this:

thuhanoi_0-1633501331762.png

 

And I want to have report to show how many participants attends by quarter, how many passed (just passed 1 training session is counted), and how many passed both training session 1 and 2. The report like this:

 

thuhanoi_2-1633501523626.png

Anyone knows how to do it as I got stuck to get number who passed both session 1 and 2, as well as to get the total number with removing duplicate (participants can attend many training session, but when we count, we just count as 1 participant).

 

Thanks!

 

 

1 ACCEPTED SOLUTION
colacan
Resolver II
Resolver II

@thuhanoi  Hi,  you may try below 2 measures.

 

To count (distinct) participant passed the test:

CountPass = CALCULATE(
DISTINCTCOUNT(TestReport[Name]),
TestReport[TestResult] = "Passed"
)
 
To count (distinct) participant passed both Session1 and Session2:
BothPassed =
VAR s1Passed =
SELECTCOLUMNS(
FILTER(
TestReport,
TestReport[Training] = "S1" && TestReport[TestResult] = "Passed"
),
"TestPassed", TestReport[Name]
)
VAR s2Passed =
SELECTCOLUMNS(
FILTER(
TestReport,
TestReport[Training] = "S2" && TestReport[TestResult] = "Passed"
),
"TestPassed", TestReport[Name]
)
VAR bothpassed =
DISTINCT(NATURALINNERJOIN( s1Passed, s2Passed ))
RETURN
COUNTROWS(bothpassed)
 
Thanks.
 
Please mark it as solution if this helped.

View solution in original post

2 REPLIES 2
thuhanoi
New Member

Thanks, it works!

colacan
Resolver II
Resolver II

@thuhanoi  Hi,  you may try below 2 measures.

 

To count (distinct) participant passed the test:

CountPass = CALCULATE(
DISTINCTCOUNT(TestReport[Name]),
TestReport[TestResult] = "Passed"
)
 
To count (distinct) participant passed both Session1 and Session2:
BothPassed =
VAR s1Passed =
SELECTCOLUMNS(
FILTER(
TestReport,
TestReport[Training] = "S1" && TestReport[TestResult] = "Passed"
),
"TestPassed", TestReport[Name]
)
VAR s2Passed =
SELECTCOLUMNS(
FILTER(
TestReport,
TestReport[Training] = "S2" && TestReport[TestResult] = "Passed"
),
"TestPassed", TestReport[Name]
)
VAR bothpassed =
DISTINCT(NATURALINNERJOIN( s1Passed, s2Passed ))
RETURN
COUNTROWS(bothpassed)
 
Thanks.
 
Please mark it as solution if this helped.

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