Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
BenRichardson
New Member

Trouble with aggregating/grouping data on bar chart

I am trying to create a simple bar chart, where it will show the amount of minutes students have spent in a particular room, with those minutes broken down by the grade they are in.  However, when I put the total minutes on the y-axis and the grade on the x-axis, it is telling me that each grade is spending 100% of the grand total of minutes in the room.  Obviously, this is not possible, it should be more like kindergarten is spending 25% of the total time in the room, 1st grade 25%, etc.  Each student is only assigned 1 grade (0-4).  A picture of my chart is posted below where I am getting the error.

BenRichardson_0-1676058449298.png

 

1 ACCEPTED SOLUTION
BenRichardson
New Member

I figured it out- just needed to change the cardinalities

 

View solution in original post

4 REPLIES 4
BenRichardson
New Member

I figured it out- just needed to change the cardinalities

 

BenRichardson
New Member

I added a calculated field to visit log to get the total minutes for each visit using this formula in the data view:

 

Time Spent (Minutes) = DATEDIFF ( 'Visit Log'[Enter Time], 'Visit Log'[Exit Time], MINUTE )
 
I then selected the data type as "Whole Number"
BenRichardson
New Member

Here are samples of my tables

 

Visit Log:

TimestampWhat is the Student ID?Before Room: How was the student feeling?After Room: How was the student feeling?What time did the student enter the room?What time did the student leave the room?(Optional) Enter any additional notesWho recommended the BeWell visit?
 91OverwhelmedSilly9:17:00 AM10:05:00 AMNotesStudent
 92NervousExcited9:19:00 AM10:08:00 AMNotesStudent
 93BoredBored9:21:00 AM10:11:00 AMNotesStudent

 

 

Student log:

TimestampStudent IDEnter the student's first nameEnter the student's last nameEnter the student's date of birthEnter the student's genderEnter the student's race
Enter the student's grade
 91JAMESSmith8/4/2011MaleAsian or Pacific Islander1
 92JOHNJohnson9/4/2011MaleBlack or African American1
 93ROBERTWilliams10/4/2011MaleHispanic or Latino2
BenRichardson
New Member

Here is my relationship - each student ID has one record for visit log and one for student log

BenRichardson_0-1676059747265.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors