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 there!
I am trying to work out the percentage of pupils who have attendance at, or below, 90% using a measure.
The attendance table ('Attendance list') looks like this:
UID | Year | Term | Present + AEA | Possible |
PupilA123 | 2021 | Term 1 | 61 | 65 |
PupilA123 | 2021 | Term 2 | 59 | 65 |
PupilA234 | 2021 | Term 1 | 61 | 65 |
PupilA234 | 2021 | Term 2 | 65 | 65 |
PupilB125 | 2021 | Term 1 | 41 | 65 |
It is filtered in Power Query so that no pupil has null or 0 Possible attendance.
I have a corresponding table called 'Pupils', which has a one to many relationship with the Attendance List (each pupil can have multiple entries in Attendance list). I also have a table called 'Pupil Characteristics', which has a many to one relationship with Pupils (each pupil can have multiple characteristics) with the filter direction going both ways.
The measure I've created doesn't seem to work as I anticipated. I need it to:
This is my measure:
Solved! Go to Solution.
@SPaine86 , try like
countx(filter(summarize(table,table[UID], table[Year], "_1",divide(sum(Table[Present + AEA]),sum(Table[Possible]))),[_1]>.9),[UID])
measure =
var _tab = filter(summarize(table,table[UID], table[Year], "_1",divide(sum(Table[Present + AEA]),sum(Table[Possible]))),[_1]>.9)
return
countx(summarize(_tab,[UID]),[UID])
@SPaine86 , try like
countx(filter(summarize(table,table[UID], table[Year], "_1",divide(sum(Table[Present + AEA]),sum(Table[Possible]))),[_1]>.9),[UID])
measure =
var _tab = filter(summarize(table,table[UID], table[Year], "_1",divide(sum(Table[Present + AEA]),sum(Table[Possible]))),[_1]>.9)
return
countx(summarize(_tab,[UID]),[UID])
Thank you, I did a minor tweaks to the code (e.g. >.9 is <=0.9) and it seems to be working nicely!
I didn't realise you could create a virtual table like this. Opens up a world of possibility...
Thank you again 🙂
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 |
---|---|
112 | |
100 | |
77 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |