Open Side Menu
Skip to contentBrand Logo
Forums
Inspiration
Ideas
Communities
Blogs
Learning
Support
RegisterSign In
  1. Microsoft Fabric Community
  2. Power BI forums
  3. Galleries
  4. R Script Showcase
fathomson's avatar
fathomson
Advocate II
9 years ago

Heatmaps

  Description An heatmap is a graphical representation of data where the individual values contained in a matrix are represented as colors. This R script shows an heatmap of calls received du...
heatmaps_in_powerbi_with_r.pbix478 KB
General R Visualizations
Anonymous's avatar
Anonymous
Not applicable
9 years ago

I wish I'd seen this posting before I started my example...:smileyhappy:

 

My version uses the same ggplot and geom_tile functions as fathomson but, rather than use R to massage the data with dplyr etc., it links directly to fields dragged from PBI - a typical Date dimension column and uses a calculated Time Bucket column as the other dimension against which to map the Call Count measure.  I DO use the  'complete' function from the 'tidyr' package to fill in missing values and avoid holes in the heatmap.

 

I also played with presenting the value of the measure on the tile and some other formatting options.  I tried to use the viridis palette package, but it's not supported on PBI Service yet.

 

Required R packages: ggplot2, ggthemes, tidyr. (see attached R script)

Matrix Heatmap

 

 

 

 

Matrix Heatmap.pbix511 KB
ScriptInstallPackagesForMatrixHeatmap.R1 KB
  • vrocca's avatar
    vrocca
    Advocate IV
    9 years ago

    Here are the links to download the packages referenced:

     

    dplyr: https://cran.r-project.org/src/contrib/dplyr_0.5.0.tar.gz

    ggplot2: https://cran.r-project.org/src/contrib/ggplot2_2.1.0.tar.gz

    ggthemes: https://cran.fhcrc.org/src/contrib/ggthemes_3.2.0.tar.gz

    zoo: https://cran.r-project.org/src/contrib/zoo_1.7-13.tar.gz

     

    Alternatively, you can install these throug R Studio by clicking on Packages > Install and entering the name of the package.

     

    Hope that helps.

  • © 2026 Microsoft
  • Manage cookies
  • Privacy & cookies
  • Terms of use
  • Trademarks
Your Privacy Choices Consumer Health Privacy