Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a list of students who are submitting internship hours. I need a measure that calculates their hours-to-date spent compared to the hours-to-date target. I have been able to create a metric that shows the ratio, but I am struggling creating a metric that counts the number of students that are on/below/above target to date. I've tried SUMMARIZECOLUMNS but that isn't meeting my needs.
I have, by student
Coach | Student | Hours to Date | Target to Date | Ratio |
AA | StudentA | 105 | 75 | 140% |
BB | StudentB | 89 | 75 | 119% |
BB | StudentC | 61 | 75 | 81% |
What I need is to create measures that calculate counts by coach
Coach | Students | Hours to Date | Target to Date | Students Behind Target | Students At or Above Target |
AA | 1 | 105 | 75 | 0 | 1 |
BB | 2 | 150 | 150 | 1 | 1 |
Any help you can provide would be most appreciated. Sample file is here.
Solved! Go to Solution.
I am thinking this should work:
I am thinking this should work:
Hi @dkernen2 ,
1.Create two measures to calculate diffierernt types
Students At or Above Target =
VAR Students =
COUNTROWS ( VALUES ( 'Table'[Student] ) )
VAR AtOrAboveTarget =
COUNTROWS (
FILTER ( 'Table', 'Table'[Hours to Date] >= 'Table'[Target to Date] )
)
RETURN
AtOrAboveTarget
Students Behind Target =
VAR Students =
COUNTROWS ( VALUES ( 'Table'[Student] ) )
RETURN
Students - [Students At or Above Target]
2.Create calculate table
Coach =
SUMMARIZE (
'Table',
'Table'[Coach],
"Students", COUNTROWS ( VALUES ( 'Table'[Student] ) ),
"Hours to Date", SUM ( 'Table'[Hours to Date] ),
"Target to Date", SUM ( 'Table'[Target to Date] ),
"Students Behind Target", [Students Behind Target],
"Students At or Above Target", [Students At or Above Target]
)
3.Final output
Best regards
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you Albert. Your solution requires a pre-aggregated table of hours to date, which I do not have. My attendance table has daily rows. I need to summarize the hours to date by student with the original table that has multiple attendance rows per student. Any thoughts?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |