Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello,
I would like to inquire about creating a measure in Power BI that allows me to identify students who have had two opportunities. I have a table called "PRO" which includes a column called "idStd" that contains the student IDs. Additionally, I have another table called "Opp" idopp" that may have duplicate values if a student has multiple opportunities. My goal is to create a measure that, when applied to a table visual, displays the count of opportunities equal to 2 along with the list of students .
Currently, I have achieved this by applying a filter directly to the table visual, where I select the Opp"idStd" column, choose the "equal to" condition, and enter the value "2". However, I would like to convert this into a measure instead.
Thank you for your assistance.
Solved! Go to Solution.
Hi @Chelly
Have you related both tables by IdStd?
If it is the case, you just need to countrows in the Opp table
Num Opp = COUNTROWS(Opp)
and display the measure along with the list of students
P.S. If you want to display all the list but with a zero value for the ones that don't have any, use:
Num Opp =
var opport= COUNTROWS(Opp)
return IF(opport=0,0,opport)and you will get:
Thanks, but i need to return student who have only 2
Then, return only
IF(opport=2,opport,blank())
| User | Count |
|---|---|
| 50 | |
| 40 | |
| 32 | |
| 14 | |
| 13 |
| User | Count |
|---|---|
| 87 | |
| 73 | |
| 37 | |
| 28 | |
| 26 |