# 10 Lab [en] - Data visalization, KPI, extensions in Tableau
###### tags: `Data Visualization` `KPI`
[TOC]
# Introduction - KPI
**KPI** (*Business English*) -- abbreviation for key performance indicator: a very important indicator (= something that shows what a situation is like or how it is changing) that shows how well an economy, company, stock, project, etc., is doing: A KPI should indicate what action needs to take place.
[How to report on KPI/KPI dashboard ??](https://www.klipfolio.com/resources/articles/what-is-a-key-performance-indicator)
# 1 Simple KPI
This excercise shows how to create a view that shows Key Progress Indicators (KPIs). A Key Performance Indicator is a measurable value that shows how effectively a company is achieving key business objectives. At a high level, the procedure requires you to do the following:
* Create a view that includes the field or fields (measures) you want to assess.
* Create the parameter, which can be used as the treshold that demarcates success from failure.
* Create a calculated field that checks if the treshold is passed.
* Update the view to use KPI-specific shape marks to show which values are above the threshold and which are below.
[Excercise full guide](https://help.tableau.com/current/pro/desktop/en-us/kpi.htm)
If you want to use own text characters to visualize KPI the best solution is to copy the characters from character map (Windows):

# 2 KPI based on time
Scheme for define KPI which shows the sales difference bewteen two years:
* define the parameter **KPI-year** that will be used to select the KPI reference year (list based on data field),
* mark all recodrs using calculated field **KPI-record** with:
* cr (current year) - label for the records from **KPI-year**,
* cr (current year) - label for the records from the year: **KPI-year** - **1**,
* choose sales values only for **cr** label (field: KPI-sales-cr) and for **cp** label (field: KPI-sales-cp)
* define text calculated fields which can be used to describe the direction fo changes in sales:
* "▲" as **KPI+** if the SUM(KPI-sales-cr)>SUM(KPI-sales-cp),
* "▼" as **KPI-** if the SUM(KPI-sales-cr)<SUM(KPI-sales-cp),
* "◄" as **KPI=** if the SUM(KPI-sales-cr)=SUM(KPI-sales-cp),
* compose the KPI widget using:
* current value of sales SUM(KPI-sales-cr)
* previous value of sales SUM(KPI-sales-cp)
* differnece between sales in cr and cp (expressed as a percentage %)
* the chcarter which color and shape reflect the direction of changes (KPI=, KPI+, KPI-).

# Extension: Show Me More 2.0
Sankey diagram (*Sankey Diagram is a visualisation technique that allows to display flows*) for showing relation between two dimensions maesured by one measure.
