2024 Week 9 | Sigma: Can you create Bar charts in this Pivot Table?

Introduction

This week have a guest author! Tausif Kazi is an expert in data visualization who is experienced in several platforms such as Sigma, Power BI, Tableau, and Snowflake.  

Connect with Tausif:
Linkedin: https://www.linkedin.com/in/tausifkazi/
Twitter: https://twitter.com/VizByTK

This challenge will cover how to create a Bar chart in Pivot Tables. This will help your users quickly understand the positive and negative values in the Pivot table itself.

Need access to Sigma?

Note: You will only have view access to WOW Workbooks, Folders, and Workspaces, not edit access. Please create your WOW Workbooks under “My Documents.” We suggest creating a folder to organize all your workbooks. 

Requirements

  • Add a data element from PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA
    • Sigma Sample Database > Retail > PLUGS_ELECTRONICS > PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA
  • Add a Pivot Table element
  • Add Profit Calculation from Metrics to Values
    • If you need to recreate Profit it is, Sum(([PRICE] – [COST]) * [QUANTITY])
    • Format [Profit] to Currency
  • Add [Store Region] then [Product Type] to Pivot Rows
  • Add Year of [Date] to Pivot Columns
  • Change the chart title to “Can you create Bar Charts in Pivot Table?”
  • Apply a condition to format a filled bar in the Pivot Table
    • Conditional Formatting Color:
      • If [Profit] is Negative then #D94021
      • If [Profit] is Positive then #D4D4D4
    • Apply only to values (not subtotals or grand totals) 
  • Pivot Table Element Size: at least 20×20
  • Hide the Data Tab

Dataset

Sigma Sample Database > Retail > PLUGS_ELECTRONICS > PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA

Share

After you finish your workout, share on LinkedIn, Sigma’s Community page, (or Twitter) using the hashtags #WOW2024 and #SigmaComputing, and tag Ashley Bennett, Eric Heidbreder, Katrina Menne, and our guest author Tausif Kazi!

Also, make sure to fill out the Submission Tracker so that we can count you as a participant this week to track our participation throughout the year.

Solution

  1. Add a table element sourced from Plugs Electronic Hands-On Lab
  2. Create a Pivot Table as a child element
  3. Add [Profit] to Values from the Metrics Tab
  4. Format [Profit] as Currency
  5. Add [Date] to Pivot Table Columns
  6. Change Date Truncation to Year 
    • DateTrunc(“year”, [Date])
  7. Add [Store Region] to Pivot Table Rows
  8. Add [Product Type] to Pivot Table Rows
  9. Click Element Format (Paintbrush icon)
  10. Click Conditional formatting
  11. Change “Apply to” to only be Profit
  12. Click “Data Bars”
  13. Click the Negative color value and change the hex code to #D94021
  14. Click the Positive color value and change the hex code to #D4D4D4
  15. Change the chart title to “Can you create Bar Charts in Pivot Table?”
  16. Move the Pivot Table Element to a separate page
  17. Hide the other tab with the parent table element
  18. Click Publish
Scroll to Top