Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello guys, I hope this finds you well!
Well, I am considerably new to Power BI and I am struggling with creating a metric that disregards some columns from the data tables.
For a more illustrative view, follows the image of the data and my explanation as to what I intend to do:
This table shows the class in which a test has been done, the number of students in this specific class and the number of students that have done the test...
I want to find out the number of students that haven't done the test by class, which for example in the first row would be 30-25 = 5 students that did not do the test... but i want to group it by class disregarding the subject of the test and the key of the test.
The measure i want to create would do something like, fixate the NU_STUDENT number by class and get an average of all rows of the NU_CONCLUDED_STUDENTS by class as well, using as an example the image i used previously, would be something like:
| NU_STUDENTS by class | AVERAGE OF ALL TESTS OF NU_CONCLUDED STUDENTS by class | DIFFERENCE (Students that haven't done the test) |
| 30 | 23 | 7 |
If you can help me find a solution to this problem or even show to me why it is possible or not, I'd appreciate it very much!
Best Regards.
Solved! Go to Solution.
Hi @ViniciusGM ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create two measures as below:
Measure =
VAR _ndstu =
MAX ( 'Table'[NO_STUDENTS] )
VAR _avgconclude =
AVERAGEX ( 'Table', 'Table'[NU_CONCLUDED_STUDENTS] )
RETURN
_ndstu - _avgconcludeDifference = SUMX ( VALUES ( 'Table'[KEY_CLASS] ), [Measure] )
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @ViniciusGM ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create two measures as below:
Measure =
VAR _ndstu =
MAX ( 'Table'[NO_STUDENTS] )
VAR _avgconclude =
AVERAGEX ( 'Table', 'Table'[NU_CONCLUDED_STUDENTS] )
RETURN
_ndstu - _avgconcludeDifference = SUMX ( VALUES ( 'Table'[KEY_CLASS] ), [Measure] )
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Thank you very much @Anonymous, that is exactly what I wanted!! And thank you for your suggestions for future posts as well!
Best Regards,
Vinicius
Hello
You can add a column with this code
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 76 | |
| 52 | |
| 51 | |
| 46 |