cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MalkheBehr
Frequent Visitor

Calculate percentage of selected row items against totals

I am a complete Power BI newbie - unleashed upon my organisation with the barest minimum of training and I'm just "technie" enough to be dangerous.

 

I am tracking intranet pageviews.  I want to calculate the percentage of particular page titles against the total number of pageviews. I have created "categories" for each of our content sections and the selected page titles fall under the MH section. Page titles rows are not unique in the table because they are tracked by fiscal/quarter:

 

MalkheBehr_0-1643224444070.pngMalkheBehr_1-1643224457501.pngMalkheBehr_2-1643224888550.png

For example:

  1. Can I create a visual that shows that selected pageviews totalling 37,660 is 34.6% of 108,660, the total number of pageviews for the whole intranet site (e.g. a pie)?
  2. Can I add a column in the above table visual example that shows that the Mental Health page is 14.6% of overall total pageviews for our intranet?

My heart tells me it can be done but my completely math-challenged brain says, "Have you met me?"

 

Thanks!

10 REPLIES 10
KNP
Super User
Super User

Ok, so, I think I've solved your first issue and gone part of the way to solving the second, but lets just start with the attached PBIX and go from there. I think it will be enough to help you along. 

 

Points to note...

  • Unless I copy and pasted wrong, the data you provided only totalled 82633 so the percentages don't match your desired result.
  • I took the list of pages you want to isolate and merged (in Power Query [Transform Data]) with your dataset and added a custom column. This helps for filtering when writing the DAX measures.
  • Created a Total Page Views measure that ignores all filters on the data table.
  • Created a Page Views (filtered) measure, filtering to only include those in the custom column I created.
  • Created a Filtered View % measure.

I hope this helps.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x
MalkheBehr
Frequent Visitor

Well drat.  My employer is using Version: 2.88.1385.0 64-bit (December, 2020) and it won't let me open the file you shared.  😞

Wow, that's really old.

With the monthly release cycle of PBI, they really should install from the Microsoft Store (auto updating version) or at least let you update regularly.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x
MalkheBehr
Frequent Visitor

Huzzah!  🐻  I was able to download the desktop update myself!  Our IT usually crushes hope but perhaps since there is a corporate licence it slipped through.  Will investigate what you so very kindly put together for me.  I am SOOO appreciative!  Am also very, very happy this resource exists.  You are a 🤴 among 👬!

MalkheBehr
Frequent Visitor

Not odd.  I work for a provincial government and we barely get by with stone knives and bearskins

Oh, right. 😶

I don't have a stone knife solution. Sorry. 🐻🔪

PBI isn't the sort of software that you can install and never upgrade. You will run into problem after problem if you can't at least operate on n - 1 e.g. the previous version.

 

Hopefully you can get it upgraded, I think I've solved most of the issues.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x
MalkheBehr
Frequent Visitor

I had to remove a ton of rows because of the space considerations which may be why final total pageviews didn't match my screenshots.  I will check out the pbix file and THANKS!!!  Will let you know how I fare.

MalkheBehr
Frequent Visitor

Not sure if the above works - just c&p 'coz didn't see an option to attach.  😕

MalkheBehr
Frequent Visitor

Page TitlePageviewsAvg Time on PageSectionFiscalQ
21 tips to keep it together with depression - InsideOPS3185.45MH2021-221
21 tips to keep it together with depression - InsideOPS2404.94MH2021-222
21 tips to keep it together with depression - InsideOPS4935.88MH2021-223
AbilitiCBT information sessions - InsideOPS6626.46MH2021-221
AbilitiCBT information sessions - InsideOPS250.44MH2021-222
AbilitiCBT information sessions - InsideOPS131.08MH2021-223
AbilitiCBT: Internet-based cognitive behavioural therapy for OPS - InsideOPS14054.52MH2021-221
AbilitiCBT: Internet-based cognitive behavioural therapy for OPS - InsideOPS20643.96MH2021-222
AbilitiCBT: Internet-based cognitive behavioural therapy for OPS - InsideOPS13304.79MH2021-223
Accident/incident response and reporting - InsideOPS6245.48HSS2021-221
Accident/incident response and reporting - InsideOPS5673.77HSS2021-222
Accident/incident response and reporting - InsideOPS5855.01HSS2021-223
Additional mental health resources - InsideOPS1021.92MH2021-221
Additional mental health resources - InsideOPS831.28MH2021-222
Additional mental health resources - InsideOPS1001.98MH2021-223
Building a Culture of Safety training - InsideOPS3823.90MH2021-221
Building a Culture of Safety training - InsideOPS2892.48MH2021-222
Building a Culture of Safety training - InsideOPS130.31MH2021-223
Building your resiliency training modules - InsideOPS15716.37MH2021-221
Building your resiliency training modules - InsideOPS6454.50MH2021-222
Building your resiliency training modules - InsideOPS15355.80MH2021-223
Client Contact List - InsideOPS9725.15CEHSW2021-221
Client Contact List - InsideOPS10384.78CEHSW2021-222
Client Contact List - InsideOPS16233.45CEHSW2021-223
COVID-19: Protecting your mental health - InsideOPS3353.57MH2021-221
COVID-19: Protecting your mental health - InsideOPS2983.09MH2021-222
COVID-19: Protecting your mental health - InsideOPS2221.98MH2021-223
Dimensions of wellness - InsideOPS1531.82MH2021-221
Dimensions of wellness - InsideOPS1322.20MH2021-222
Dimensions of wellness - InsideOPS1482.17MH2021-223
Disability support - InsideOPS5221.18DSS2021-221
Disability support - InsideOPS6531.34DSS2021-222
Disability support - InsideOPS5711.00DSS2021-223
EFAP online manager resources - InsideOPS1701.56MH2021-221
EFAP online manager resources - InsideOPS1611.73MH2021-222
EFAP online manager resources - InsideOPS1881.85MH2021-223
Employee and Family Assistance Program – Family support services - InsideOPS512.63MH2021-221
Employee and Family Assistance Program – Family support services - InsideOPS662.43MH2021-222
Employee and Family Assistance Program – Family support services - InsideOPS483.62MH2021-223
Employee and Family Assistance Program - InsideOPS41365.10MH2021-221
Employee and Family Assistance Program - InsideOPS36525.38MH2021-222
Employee and Family Assistance Program - InsideOPS39655.58MH2021-223
Employee Health, Safety and Wellness - InsideOPS6710.89CEHSW2021-221
Employee Health, Safety and Wellness - InsideOPS5210.99CEHSW2021-222
Employee Health, Safety and Wellness - InsideOPS5981.32CEHSW2021-223
Employee mental health - InsideOPS2893.19MH2021-221
Employee mental health - InsideOPS17824.24MH2021-222
Employee mental health - InsideOPS6462.82MH2021-223
Employment accommodation - InsideOPS4034.07DSS2021-221
Employment accommodation - InsideOPS5503.50DSS2021-222
Employment accommodation - InsideOPS5452.93DSS2021-223
Ergonomics - InsideOPS7694.38HSS2021-221
Ergonomics - InsideOPS6163.75HSS2021-222
Ergonomics - InsideOPS6024.76HSS2021-223
Health and safety services - InsideOPS20760.98HSS2021-221
Health and safety services - InsideOPS15591.24HSS2021-222
Health and safety services - InsideOPS19761.29HSS2021-223
Health reassignment - InsideOPS2045.13DSS2021-221
Health reassignment - InsideOPS1703.96DSS2021-222
Health reassignment - InsideOPS1573.32DSS2021-223
Health, safety and wellness training - InsideOPS3990.62HSS2021-221
Health, safety and wellness training - InsideOPS2070.83HSS2021-222
Healthy living - InsideOPS2591.68WELL2021-221
Healthy living - InsideOPS1651.47WELL2021-222
Healthy living - InsideOPS2842.95WELL2021-223
Healthy Workplace, Healthy Mind - InsideOPS5013.51MH2021-221
Healthy Workplace, Healthy Mind - InsideOPS3434.78MH2021-222
Healthy Workplace, Healthy Mind - InsideOPS4414.82MH2021-223
Introduction to mindfulness - InsideOPS10234.44MH2021-221
Introduction to mindfulness - InsideOPS9264.88MH2021-222
Introduction to mindfulness - InsideOPS5324.52MH2021-223
Joint health and safety committees / health and safety representatives - InsideOPS9607.39MH2021-221
Joint health and safety committees / health and safety representatives - InsideOPS6455.55MH2021-222
Joint health and safety committees / health and safety representatives - InsideOPS16316.37MH2021-223
Mental health - InsideOPS4030.91MH2021-221
Mental health - InsideOPS3761.97MH2021-222
Mental health - InsideOPS151362.82MH2021-223
Mental Health Champions Committee - InsideOPS6204.23MH2021-221
Mental Health Champions Committee - InsideOPS2854.02MH2021-222
Mental Health Champions Committee - InsideOPS3583.18MH2021-223
Occupational health and safety overview and policies - InsideOPS3952.14HSS2021-221
Occupational health and safety overview and policies - InsideOPS2361.37HSS2021-222
Occupational health and safety overview and policies - InsideOPS2443.83HSS2021-223
Personal protective equipment - InsideOPS1024.43HSS2021-221
Personal protective equipment - InsideOPS1241.71HSS2021-222
Personal Protective Equipment - InsideOPS1181.50HSS2021-223
Personal protective equipment - InsideOPS795.82HSS2021-223
Post-traumatic stress disorder - InsideOPS1912.27MH2021-221
Post-traumatic stress disorder - InsideOPS1081.72MH2021-222
Post-traumatic stress disorder - InsideOPS1482.06MH2021-223
PTSD Awareness Day - InsideOPS3743.27MH2021-221
PTSD Awareness Day - InsideOPS330.47MH2021-222
PTSD Awareness Day - InsideOPS417.05MH2021-223
Return to work - InsideOPS1493.58DSS2021-221
Return to work - InsideOPS2852.99DSS2021-222
Return to work - InsideOPS1925.01DSS2021-223
Scented products and food allergens - InsideOPS645.05HSS2021-221
Scented products and food allergens - InsideOPS337.22HSS2021-222
Scented products and food allergens - InsideOPS796.81HSS2021-223
Self-Care Challenge 2021 - InsideOPS19535.81MH2021-221
Self-Care Challenge 2021 - InsideOPS252.34MH2021-222
Self-Care Challenge 2021 - InsideOPS45.55MH2021-223
Sharing Our Lived Experiences Campaign - InsideOPS8245.06MH2021-221
Sharing Our Lived Experiences Campaign - InsideOPS1364.06MH2021-222
Sharing Our Lived Experiences Campaign - InsideOPS11307.53MH2021-223
Student health and safety - InsideOPS211.69HSS2021-221
Student health and safety - InsideOPS811.68HSS2021-222
Wellness and mental health - InsideOPS18671.26MH2021-223
Wellness and mental health training - InsideOPS10573.09MH2021-221
Wellness and mental health training - InsideOPS3313.53MH2021-222
Wellness and mental health training - InsideOPS5413.36MH2021-223

 

The page titles I need to isolate are:

AbilitiCBT: Internet-based cognitive behavioural therapy for OPS - InsideOPS
COVID-19: Protecting your mental health - InsideOPS
Employee and Family Assistance Program - InsideOPS
Employee Health, Safety and Wellness - InsideOPS
Healthy Workplace, Healthy Mind - InsideOPS
Mental health - InsideOPS

Mental Health Champions Committee - InsideOPS

 

Thanks in advance!

KNP
Super User
Super User

Hi @MalkheBehr,

 

Should be easy enough. Can you paste some raw data (not a screen shot) for us to work with.

Mask anything that is sesitive obviously.

 

I'll move this over to the 'Desktop' section of the forum as this is not really Power Query specific.

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors