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
ChloeLong
Frequent Visitor

How to count across rows in a matrix visual

Hi Team

 

I am compiling a fairly decent set of data where I have data across 11 columns that contain true/false.  It's an attendance list and I only care about those who attended. I've created a measure for each week to count the number of trues.  I have then put this in a filter by unit and class.  This is all great but I would love to get a total on the right side that shows the total the number of attendances each unit.  EG for ANAT1001 I would like to see 153.  

 

ChloeLong_0-1682067073809.png

 

I've looked for solutions but most of them require going back to the actual data table but as my measures are in there I don't know how to create a column that counts the measures.

 

Any help greatly appricated 

 

Chloe

 

1 ACCEPTED SOLUTION
john_mulqueen
New Member

Can you unpivot the source table so that each week isn't a separate column but rather a single column with the value indicating the week that it belongs to? This would normalize your dataset and make this kind of modeling easier to work with.  

 

For example take this

john_mulqueen_0-1682074810589.png

 

and turn it into this 

john_mulqueen_1-1682074828948.pngjohn_mulqueen_2-1682074859217.png

 

View solution in original post

2 REPLIES 2
ChloeLong
Frequent Visitor

Hi John,

 

Thanks so much for that, unpivoting those columns in my dataflow enabled me to get a matrix table that had both row and column totals.

 

An additional benefit was that instead of having to have 12 separate measures to count each column I only needed one to count the values column.

 

ChloeLong_1-1682916152453.png

 

Thanks again!

 

Chloe

john_mulqueen
New Member

Can you unpivot the source table so that each week isn't a separate column but rather a single column with the value indicating the week that it belongs to? This would normalize your dataset and make this kind of modeling easier to work with.  

 

For example take this

john_mulqueen_0-1682074810589.png

 

and turn it into this 

john_mulqueen_1-1682074828948.pngjohn_mulqueen_2-1682074859217.png

 

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.