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

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.

Reply
MattSwan
Frequent Visitor

Missing Totals from Table Visual

Hi there,

 

My first post! Fairly new to Power BI. I think this is an issue with how I've setup my query, but here goes.

 

I have two tables linked via an ID. One containing Student details and one attendance data. It's a one-many relationship.

 

I have created two calculated columns in the attdnance table that result in columns of ones and zeros, which is working fine.

 

I have created a measure that divides the sum of one columns ones by the other columns ones to give a % and this works too.

 

The final step in my measure is a condition that returns a one or zero if a value is below 90.

 

PA Pupils = if(DIVIDE(sum(attendance[Present]),SUM(attendance[Possible]))*100<90,1,0)
 
Now this works and when I copy it into a table that contacins a list of students it gives me ones and zeros where appropriate for each student. What it doesn't give me is a total at the bottom. The total remains zero no matter the number of ones in the column above. I have also tried to display the total in a Card visual and this also gives me zero.
 
Anyone have any suggestions what I might be doing wrong?
 
PA Issue.JPG
 
Thanks in advance.
1 REPLY 1
moizsherwani
Continued Contributor
Continued Contributor

Welcome to the world of PowerBI 😀. One of the first problem Excel migrants face is the same one you are facing (the totals don't add up or aren't correct). The totals in PowerBI don't work as you might think. In your case, when the formula comes to the total part of the table it considers the 9 and the 6 (the totals of the first two columns as per your snippet) and evaulates the formula based on these two values which is why you are probably always getting "0". There is a number of way to add these numbers and without knowing your exact data model / end goals I cannot suggest the best one but one method would be to use an aggregator function such as SUMX (see below) and drag it into the table and see if the correct result shows up in the total (again this may not be correct becase I do not know the table structure for the attendance table)

 

 

 

 

PA Puplis Total = SUMX (attendance, [PU Pupils])

 

 

 

 

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors