The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone!
I need urgent help.
My database is of the grades of a school, for which I must count students who lost each of the subjects for a certain period.
The calculation of the final grade (whether you lose or not) is the average of several grades assigned to the student in the same subject.
Below I show the student's grades in mathematics in year 11. To know if he lost it or not I must get his average and if that average is greater than 2.0 the matter passes, otherwise he loses.
My problem is that when I add the column (Score_Code) to a table-type visualization, it correctly places the student's average in the subject. As shown in the FinalScore column of the following table.
But after that I need to know for that subject in that grade how many students lost, so I created a measure that assigns 0 when the student is above or equal to 2 and 1 when he is below, as seen in the image above in the column "Measure", where in that table he assigns it correctly.
But having a general table of the subject with the count of the aspects evaluated (the number of notes taken in the subject), count of students of the course, and the average of grades comes out correctly, but when adding the measure does not make me the sum of the 1, to know how many of them lost.
Someone can help me please!
Solved! Go to Solution.
Hi, @Syndicate_Admin
You can try the following methods.
Measure2 =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALL ( 'Table' ),
[Measure] = 1
&& [Subject] = SELECTEDVALUE ( 'Table'[Subject] )
)
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Syndicate_Admin
You can try the following methods.
Measure2 =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALL ( 'Table' ),
[Measure] = 1
&& [Subject] = SELECTEDVALUE ( 'Table'[Subject] )
)
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.