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.
I am measuring persistent absence for students in our school which is anybody with less than 90% attendance. The issue I have is that some are being returned blank. Now some are blank because they are educated at another establishment although they are on our roll. But a couple are blank because they are school refusers and so don't attend anywhere and I do need them to show as less than 90%. The DAX I use is the below.
%att = [n_present]/([n_auth_abs]+[n_unauth_abs]+[n_present])
Those I need to show, for example, as 0% would have 0/0+120+0 whereas those I need to stay blank would be 0/0+0+0 as they do not need to attend.
If I do the usual
%att = [n_present]/([n_auth_abs]+[n_unauth_abs]+[n_present])+0
then those who do not need to attend show as 0% and are then included when I calculate my persistently absent students.
Hi @IanGladden
Could you check to see if the denominator returns 0 and if so, return blank, otherwise calculate the %?
For example:
%att =
VAR Denominator = ( [n_auth_abs] + [n_unauth_abs] + [n_present] )
VAR Result =
IF (
Denominator = 0,
BLANK (),
DIVIDE ( [n_present], Denominator )
)
RETURN
Result
Note: I've used the DIVIDE function to avoid any divide by zero errors.
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 |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |