Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi!
I am very new to Power BI and this is my first post here on the Power BI forums. I have previously found quite a few gems on here that I applied to my work. I am hoping I might get an answer to my problem below:
I am working with a student academic performance dataset. I am required to create a list of top 10 best performing students as well as a list of 10 at-risk (worst performing) students. This is easily done using Filters. Where I am facing an issue is I need to add a condition to the list of 10 at-risk students. If the total mark is below 50, then I show them on the list, otherwise I leave the list empty. My pseudocode is something like this,
If 'GradingData'[Total] < 50, then show in table else leave table empty.
How can I go about achieving this? Thank you in advance!
Solved! Go to Solution.
Hi @AyeshaA10 ,
You can use filters in your case to showcase your results:
Hope this helps, please let me know if this doesnot work out.
Create a measure like
Is At Risk =
VAR CurrentStudent =
SELECTEDVALUE ( 'Grading Data'[Student ID] )
VAR AtRiskStudents =
TOPN ( 10, ALL ( 'Grading Data' ), 'Grading Data'[Total], ASC )
VAR VisibleAtRiskStudents =
SELECTCOLUMNS (
FILTER ( AtRiskStudents, 'Grading Data'[Total] < 50 ),
'Grading Data'[Student ID]
)
VAR Result =
IF ( CurrentStudent IN VisibleAtRiskStudents, 1 )
RETURN
Result
and add this as a visual level filter to only show when the value is 1
Thank you very much for your help! I've saved this DAX measure. I think this is going to come in handy later.
Create a measure like
Is At Risk =
VAR CurrentStudent =
SELECTEDVALUE ( 'Grading Data'[Student ID] )
VAR AtRiskStudents =
TOPN ( 10, ALL ( 'Grading Data' ), 'Grading Data'[Total], ASC )
VAR VisibleAtRiskStudents =
SELECTCOLUMNS (
FILTER ( AtRiskStudents, 'Grading Data'[Total] < 50 ),
'Grading Data'[Student ID]
)
VAR Result =
IF ( CurrentStudent IN VisibleAtRiskStudents, 1 )
RETURN
Result
and add this as a visual level filter to only show when the value is 1
Thank you very much for your help! I've saved this DAX measure. I think this is going to come in handy later.
Hi @AyeshaA10 ,
You can use filters in your case to showcase your results:
Hope this helps, please let me know if this doesnot work out.
Thank you so much for your help. This worked great!
Glad to help! 🙂
User | Count |
---|---|
117 | |
73 | |
58 | |
49 | |
48 |
User | Count |
---|---|
171 | |
122 | |
60 | |
59 | |
56 |