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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Ruth_Smalley
Regular Visitor

Percentage total by total for that year, not total over multiple years

Hi,

 

First time poster so please be gentle!

 

I have a table of information covering multiple academic years.  Each line has a value of 'On campus' or 'Off campus'.  I use a date table to show the data by academic years.  

 

I have a table showing the % of use which is on of off campus:

Ruth_Smalley_0-1738677529844.png

The percentage is calculated with a formula 

Percentage usage = DIVIDE(COUNT(EZProxy[On/Off campus]),CALCULATE(COUNT(EZProxy[On/Off campus]),ALL()))
 
This work if I filter the chart to a single academic year, but I would like it to show the % on/off campus for each academic year, rather than totalling and working out the % across the total data (so 2020-21 would be 86% off and 14% on campus.
 
Any help appreciated!
 
Ruth
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Ruth_Smalley try this:

 

Percentage usage = 
DIVIDE (
    COUNT ( EZProxy[On/Off campus] ),
    CALCULATE ( 
         COUNT ( EZProxy[On/Off campus] ),
         ALL(), 
         VALUES ( EZProxy[Academic Year] )
    )
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@Ruth_Smalley glad to hear



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Ruth_Smalley try this:

 

Percentage usage = 
DIVIDE (
    COUNT ( EZProxy[On/Off campus] ),
    CALCULATE ( 
         COUNT ( EZProxy[On/Off campus] ),
         ALL(), 
         VALUES ( EZProxy[Academic Year] )
    )
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you so much for replying.  This has worked like a charm!

 

Ruth

Greg_Deckler
Community Champion
Community Champion

@Ruth_Smalley Try using ALLSELECTED instead of ALL



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.