skip to main content
Power BI
    • What is Power BI
    • Why Power BI
    • Customer stories
    • Data visuals
    • Security
    • Power BI Desktop
    • Power BI Pro
    • Power BI Premium
    • Power BI Mobile
    • Power BI Embedded
    • Power BI Report Server
  • Pricing
    • Azure + Power BI
    • Microsoft 365 + Power BI
      • Energy
      • Healthcare
      • Manufacturing
      • Media
      • Retail
    • For analysts
    • For IT
      • Overview
      • Embedded analytics
      • Power BI visuals
      • Automation
      • Documentation
      • Community
    • Overview
    • Find consulting services
    • Partner showcase
    • Find a partner
    • Become a partner
    • Instructor-led training
    • Getting started
      • Overview
      • Online workshops
      • Self-guided learning
      • Webinars
      • Documentation
      • Roadmap
      • Overview
      • Issues
      • Give feedback
    • Blog
    • Business intelligence topics
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • Events
    • User groups
    • Community blog
    • Register
    • ·
    • Sign in
    • ·
    • Help
    Go To
    • Galleries
    • Community Connections & How-To Videos
    • COVID-19 Data Stories Gallery
    • Themes Gallery
    • Data Stories Gallery
    • R Script Showcase
    • Webinars and Video Gallery
    • Quick Measures Gallery
    • 2021 MSBizAppsSummit Gallery
    • 2020 MSBizAppsSummit Gallery
    • 2019 MSBizAppsSummit Gallery
    • Events
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Microsoft Power BI Community
    • Galleries
    • Quick Measures Gallery
    • SVG Microchart - Harveyball and Harveybox

    SVG Microchart - Harveyball and Harveybox

    08-14-2018 12:49 PM - last edited 08-14-2018 13:00 PM

    Super User TomMartens
    Super User
    20717 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    TomMartens
    Super User TomMartens
    Super User
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    SVG Microchart - Harveyball and Harveybox

    ‎08-14-2018 12:49 PM

    With the August 2018 release it's possible to assign a data category to a measure, this allows to make a measure representing an svg chart 

     

    For additional details on the method, please see this post on the DataVeld blog 

    or my own post about this microchart.

     

    Both visual types the circular "Harveyball" and  angled "Harveybox" are basically comparing two percentages. The Harveyball visual can also be used with just one circle, or better just a segement an arc.

     

    Everything is controlled with two of measures

    • Measure Achievement
      This measure controls the larger circle of the Harveyball and the right vertical line of the Harrveybox
    • Measure Achievement
      This measure cotrols the smaller circle of the Harveyball and the left vertical line of the Harveybox.

    Replace the calculation with your own calculation and make sure that the measure returns a value >= 0 and <= 1. I tried my best to take some precautions that all other input are treated as an error.

     

    This means that you need to copy four measures from the pbix file to your own model

    • Measure Achievement
    • Measure Effort
    • Harveyball (make sure that the data category is set to "Image Url")
    • Harveybox (make sure that the data category is set to "Image Url")

     

    After the above mentioned preparations the measures "Harveyball" and/or "Harveybox" can be used inside the table or matrix visual.

     

    The measures "Measure Achievement" and "Measure Effort" also provide an "input parameters" here you can configure the color (provide HEX codes) and also if you want to show an element of the visua. The input section looks for the measure "Harveyball" looks like this:

     

     

    // input parameters
    // Background Circle: represents percentage of current achievements (100% means everything is done)
    var ShowBackGrndCircle = TRUE()
    var BackGrndPercent = [Measure Achievement] // value has to be >= 0 and <=1// using Firefox one has to use "%23" instead of the "#"-sign
    var BackGrndColor = "#D9D9D9" //D9D9D9
    // Front Circle: represents effort spent for the current achievements in percent of available ressources (100% means there are no more ressources available)
    var ShowFrontCircle = TRUE()
    var FrontPercent =  [Measure Effort] // value has to be >= 0 and <=1
    var FrontColorGood = "#68CDFE" //68CDFE
    var FrontColorBad =  "#E86232" //E86232
    // Show text below the circles
    var ShowText = FALSE()
    var HarveyBallSubtitle = "a measure" //replace the string by a value or string that will be printed

     

    Basically the filled arcs and also the polygons of the Harveybox are drawn by using the path element. 

     

    I wish you all a lot of fun using this kind of visual.

     

      

     

    eyJrIjoiYTQ4NTBlMDMtNTBlMy00ZTQyLTk1NWQtY2U3NmU2NDAxOTg5IiwidCI6ImY2MmI4ZjIwLWYxNmUtNGE2ZS05YjFmLTZlMmQyZTZhYzA4OSIsImMiOjh9



    Did I answer your question? Mark my post as a solution, this will help others!

    Proud to be a Super User!
    I accept Kudos 😉
    Hamburg, Germany
    Preview file
    26 KB
    Microcharts - Harveyball.pbix
    Labels:
    • Labels:
    • Other
    Message 1 of 5
    20,717 Views
    8
    Reply
    • All forum topics
    • Previous Topic
    • Next Topic
    jtnn60
    jtnn60
    New Member
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎05-11-2020 05:52 AM

    I notice that the SVG files presented inside a table row in this demo and every other example of using SVG are always square (i.e. have a ratio of 1:1).  I understand this is a restriction on Power BI table matrix.   

     

    Do you know if there is a way around this restriction?  Or do you know if the problem will be fixed in Power BI?

    Message 5 of 5
    12,603 Views
    0
    Reply
    Sohail
    Sohail Advocate IV
    Advocate IV
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎08-15-2018 01:24 AM

    Thank you, really good a way to present the data. Any Ideas when will it will added to Qucik Measure in Power BI Desktop?

    Message 2 of 5
    20,641 Views
    0
    Reply
    TomMartens
    Super User TomMartens
    Super User
    In response to Sohail
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎08-15-2018 01:58 AM

    Hey,

     

    I'm sorry I can't say if it will become a "real" Quick-Measure.

     

    Regards,

    Tom



    Did I answer your question? Mark my post as a solution, this will help others!

    Proud to be a Super User!
    I accept Kudos 😉
    Hamburg, Germany
    Message 3 of 5
    20,635 Views
    1
    Reply
    Sohail
    Sohail Advocate IV
    Advocate IV
    In response to TomMartens
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎08-15-2018 02:02 AM

    It would be very easy to use if it make to Quick measure.. Anyways Great Work Sir. Thank you! 🙂

    Message 4 of 5
    20,632 Views
    0
    Reply

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Pages
    • Power Automate
    • Power Virtual Agents

    • Sign in
    • Sign up

    Browse

    • Solutions
    • Partners
    • Consulting Services

    Downloads

    • Power BI Desktop
    • Power BI Mobile
    • Power BI Report Server
    • See all downloads

    Learn

    • Guided learning
    • Documentation
    • Support
    • Community
    • Give feedback
    • Webinars
    • Developers
    • Blog
    • Newsletter

    © 2023 Microsoft

    Follow Power BI

    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Trademarks
    California Consumer Privacy Act (CCPA) Opt-Out Icon Your California Privacy Choices