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.
Hi,
I am very new to Power BI
I have a table with exams results for students. Each student has a unique "ID number". Students who fail the exam can retake it as many times as they want.
I want to extract or filter the student number "ID number" of students who never passed the exam.
Any idea?
Thank you
Solved! Go to Solution.
Hi @casiopony ,
Please add a new column with below dax formula:
never passed =
VAR cur_id = [id]
VAR tmp =
FILTER ( ALL ( 'Table' ), 'Table'[id] = cur_id )
VAR _str =
CONCATENATEX ( tmp, [result], "," )
RETURN
IF ( CONTAINSSTRING ( _str, "passed" ), BLANK (), "Yes" )
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @casiopony ,
Please add a new column with below dax formula:
never passed =
VAR cur_id = [id]
VAR tmp =
FILTER ( ALL ( 'Table' ), 'Table'[id] = cur_id )
VAR _str =
CONCATENATEX ( tmp, [result], "," )
RETURN
IF ( CONTAINSSTRING ( _str, "passed" ), BLANK (), "Yes" )
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
That is exactly what I was looking for. Thank you so much 🙏
This is your table, create 3 main measures
1)
I hope this is what tyou are searching for....
Let me know it is usefull or not....
Thank you.
Should I duplicate the table in POwer Query before doing this as I will still need access to the Passed information in other reports?
Yeah sounds good.
Feel free to mark as a solution if all okay 🙂
What does the table look like? Even if you can use example data it would help. You basically need to filter by some other column that indicates whether a student has failed the exams/never passed. You could first implement this in Excel or the original table by doing something that tells you whether there has been any instances of a student passing. Like a COUNTIF or IF statement?
Hi, thanks for the quick reply
the table looks like this (it has 220 000 row and growing)
id | name | result |
456 | jack | failed |
456 | jack | failed |
456 | jack | passed |
123 | john | failed |
123 | john | failed |
789 | michelle | failed |
789 | michelle | failed |
789 | michelle | failed |
789 | michelle | failed |
789 | michelle | failed |
741 | ahmed | failed |
741 | ahmed | passed |
I would like to be able to filter so it shows me that john and michelle never passed the exam. Maybe use a formula in a new column to tag those who never passed so it can then be filtered this way.
Okay, in Power Query/BI I would filter the Result column by 'Failed' then 'Remove Duplicates' on the ID column (just in case multiple people with same name). This should then give you all the names/IDs of students that have failed/never passed and will be updated live if you refresh it.
That doesn't work I am afraid. If I start by filter out by 'failed', my report will ignore whether a student id passed on another attempt.
I think i need to a formula that creates a 'never passed' column like this:
id | name | result | never passed |
456 | jack | failed | |
456 | jack | failed | |
456 | jack | passed | |
123 | john | failed | yes |
123 | john | failed | yes |
789 | michelle | failed | yes |
789 | michelle | failed | yes |
789 | michelle | failed | yes |
789 | michelle | failed | yes |
789 | michelle | failed | yes |
741 | ahmed | failed | |
741 | ahmed | passed |
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |