Blogs

Blogs

How to Create PowerBI HeatMap

A step by step process showing you how to create a heatmap in Power BI Photo by Clay Banks on Unsplash Heatmap is a type of visualization that is used to project the mass of data on a map for any given point. We can say it’s a specialized chart that uses colors to represent data values in a table. We’ll find it most useful when we need to plot large and complex data. Now, let’s look at what PowerBI Heatmap is. A Power BI Heatmap is a graphical representation of data in which individual values in a matrix are represented as colors. Seeing the colors helps us understand the chart clearly. A solid example to show the usefulness of HeatMaps is Weather Forecast. I’m very sure at a point we’ve seen news channels where a reporter shows the weather forecast- what the weather will be in the future and sometimes they report on what the weather has been in the past. They always show us areas or regions with different temperatures ranging from low to high with some color contours. Let’s move on to how we can create a HeatMap. We will demonstrate with an Earthquake data. We will create a PowerBI heatmap for earthquakes occurring in a given period of time. Step 1 Open your PowerBI Desktop and load the earthquake data in your report. Load the data by clicking on Get Data → select your file type i.e. Excel, text/CSV, Web, SQL Server etc.c. Then click on Load. We then have our data in our report which we can see on the Field Tab. Now, what we need to do is to check under our visualization if we have the HeatMap amongst the various charts. Step 2 On checking the Visualization tab, we don’t have the Heatmap present amongst charts. What we need to do is to add to the interface. We can do that by clicking on the three-dot option which brings up a list of options.Then we select Get more visuals. Step 3 After Selecting Get more visuals, we’ll be asked to sign in to Microsoft account. After that, it opens up a new page where we can find different PowerBi visuals to add to our report. What we need is the Heatmap, so we go to the Search bar and type in HeatMap, then we select the first item on the search return list. After selecting the item, it opens up a new page for the Heatmap then we click on Add. It then automatically adds this to our visualization tab. Ensure you are connected to a network while doing this. We can see we have the heatmap in our visual. We can now proceed to build our chart. Step 4 What we will do now is select the different fields we need in our report. Just like what we have below, we add each field respectively. After then we can see our Earthquake map in our report, just as shown below. In the above picture, we have more earthquakes in areas colored black and fewer earthquakes in areas with light blue colors. For us to see more better regions in our map and as well improve the quality of our view, we need to click on the Format option on the visualization panel and then look for Renderer and change the Renderer type to Heat as shown below. Whenever we do that, we should have the chart below. What this is telling us is that the areas with red color show us regions with more earthquakes and regions with blue color have fewer earthquakes just as we mentioned earlier. Step 5 Now, we can add more colors to make our map more visible and clearer. Let’s do this in that same Format tab option. Check among list of Options, we should find Heat map under Renderer, click on it and change any of the colors of the levels we find there just as shown below. Change the Level5 color to Red, so we should have a different chart below. Here is what our chart looks like. We can also change other level colors in the Heatmap options. How to Create HeatMap Table It is also possible to create a HeatMap Table. We can create a heatmap table by clicking on the table visual in the visualization panel. We will add the necessary fields we need, just like the example below. We will also change the style of our table to Minimal and turn on the background and font color under the Format tab options. Then we should have our table as seen below Turn on the Background and font color (Value) here under these options. Finally, change the font colors to our desired choice. We should have a table heatmap as shown below. Hope you enjoyed this post. Thanks for reading.

Blogs

What is PowerBI Dataflows?

An Introduction to the Concept of Dataflow in Power BI Photo by Adeolu Eletu on Unsplash With the increase in data volume and challenges of wrangling data into well-formed, actionable information, we need to have ready-made data which we can populate into reports or dashboards. To make this possible, we need Power BI Dataflows. The Power BI Dataflow is the data transformation component in Power BI. It is a Power Query process that runs in the cloud, independent of Power BI report and dataset, and stores the data into CDM: Common Data Model inside Azure Data Lake storage. Why Use Power BI Dataflows? We use PowerBI Dataflows for reusability purposes. You can share Power BI dataflows with other people across the Power BI environment. If you have a library that has many Power Queries (“M” scripts), you should consider creating Power BI dataflows. Power BI dataflow is regarded as a low-code/no-code solution. We don’t need to write a single line of code to perform data transformations. Dataflows can be created using Power Query Online, which is a powerful transformation tool. Dataflows are also designed to work with very large amounts of data. Hence, we don’t need the Power BI Desktop client to create a Power BI dataflow. This is because we have the ability to perform the data preparation in the Power BI portal. You can schedule all dataflows that require different refresh timings individually. Whenever you use the Power BI Premium/Embedded capacity, you can also enable incremental refresh for Power BI dataflows entities that have a DateTime column. How to use DirectQuery with DataFlows There are several reasons using DirectQuery with dataflows is useful and helpful. Some of the reasons are; Working with large dataflows Decreasing orchestration needs for dataflows Serving data to customers in a managed and performance-minded way Preventing the need to duplicate data in dataflow and an imported dataset The Configuration of using DirectQuery with DataFlows When carrying out the configuration, there are four items you must validate if you’re using the original version of Power BI Premium. These are ; The enhanced compute engine must be toggled to On in dataflow settings and the specific dataflow. You must connect to the data source using the Power BI dataflows connector. Run the latest version of Power BI Desktop. Follow the steps below to connect with Power BI Desktop: a. Sign out of Power BI Desktop b. Clear the dataflows connection, which requires you to sign in by doing this; Select File > Options and settings > Data source settings > Delete Power BI dataflows c. Also ensure the enhanced compute engine is on, and you have refreshed the connection whenever your connection is using the Power BI dataflows connector. For a user using Premium Gen2, you should follow the following steps : Navigate to the Premium dataflow and set the enhanced compute engine to On. Navigate to the dataflow settings section for the target dataflow and turn on the enhanced compute engine for the dataflow. Refresh the dataflow. When you complete these steps, the dataflows will be accessible in Power BI Desktop with DirectQuery mode. Thanks for reading.

Blogs

DAX Functions in Power BI

Data Analysis Expressions (DAX) is a formula expression language used in Power BI, and Power Pivot in Excel. DAX formulas include functions, operators, and values to perform advanced calculations and queries on data in related tables and columns in tabular data models. In DAX functions in PowerBI, we can create new data from existing data. We can create new data such as aggregated, summarized e.t.c Now, let’s move to different aspects where we can use our DAX functions. We can use DAX functions in Calculated Columns, Measures, and Tables. We’ll study how we can use DAX in each of the data. Calculated Columns A calculated column allows us to create a new column from our data. For instance, let’s say we want to calculate the Discount Percentage of a particular product, whereby in our Data both Discount and List Price data are available. We can use DAX Function to calculate this by using the formula below: 1(Discount/Price) × 100 Measures We can also create calculations using the measure. We also need to note that Measure calculation works slightly differently from Column calculation. The helpful thing about Measure calculation is that it won’t create an entire column in your data, unlike the calculated column. An example of that is shown below; 1] Discount * Price Tables Using DAX functions in tabular model return entire new tables. For example, we can get the state students in a particular school, reside using the function; 1 state = DISTINCT(Students[State]) The Most Commonly Used DAX Functions are: SUM, MIN, MAX, AVG COUNTROWS, DISTINCTCOUNT IF, AND, OR, SWITCH ISBLANK, ISFILTERED, ISCROSSFILTERED VALUES, ALL, FILTER, CALCULATE UNION, INTERSECT, EXCEPT, NATURALINNERJOIN, SUMMARIZECOLUMNS, NATURALLEFTEROUTERJOIN, ISEMPTY MEDIAN, GEOMEAN, DATEDIFFPower BI DAX Functions Average This DAX function allows us to find the average from a given set of values as shown below; ItemAvg= AVERAGE(Items[Price]) Concatenate We can use Concatenate to join values in calculated columns. If you’re working with Measure calculation, you can use the ConcatenateX. ProMrp = CONCATENATE(Items[name],Items[code]) Max We can use MAX to calculate the maximum from a given set of values. HighestItemSold = MAX(Items[Price]) Min We can use MIN to calculate the minimum from a given set of values. LowestItemSold = MIN(Items[Price]) Count Count can also be used to count the number of values in the column. Let’s define a measure to count all sales transactions: number of sales=COUNT(Items[Sales_Id]) TotalYTD The TotalYTD function allows us to calculate the sum from the start of the current Year to the specified date. ourcumlSales = TOTALYTD(SUM(Items[Price]),Invoices[Date]) Thanks for reading this post.

Blogs

MYSQL Functions: All You Need to Know

MySQL is an open-source relational database management system. For you to add, access, and process data stored in a computer database, you need a database management system such as MySQL Server. Now, we need to understand what MySQL Functions are. A function is basically a stored program that you can pass parameters into and then return a value. They are simply pieces of code that perform some operations and then return a result. We will look at the different types of functions we have. Types of functions MySQL came wrapped up with different built-in functions. These built-in functions are functions that have been implemented on the MySQL server. With these functions, we can perform different types of manipulations on our data. We can classify these functions into the different categories below; Numeric functions — These are functions that operate on numeric data types Strings functions — These are functions that operate on string data types Aggregate functions — These are functions that operate on all different data types and produce summarized result sets. Date functions — They are functions that operate on date data types. We will discuss each of these different functions one after the other Numeric functions For numeric functions, we can perform mathematical calculations on numeric data in the SQL statements. Here, we have the Arithmetic operators which consist of the following operators in which we can compute Division, Subtraction, Addition e.t.c. on any numeric data. Addition operator (+) 1SELECT 50 + 2 ; Whenever we run this script, this should return 52 Integer Division (DIV) 1SELECT 51 DIV 6 ; Whenever we run the above script, it should give us 8 Division operator (/) 1SELECT 51 / 2 ; Whenever we run the above script, it should give us 25.5 Subtraction operator (-) 1SELECT 51-6 ; Whenever we run the above script, it should give us 45 Now, let’s move to the strings functions Strings Functions As we mentioned earlier the different operators the numeric functions entail, we have the same here. The string function takes a string value as an input regardless of the data type of the returned value. There are many built-in string functions available for use, some of these are listed below; An example on CONCAT and CHAR_LENGTH is done below; CONCAT 1 mysql> SELECT CONCAT(‘My’, ‘S’, ‘QL’); 2 +———————————————————+ 3 | CONCAT(‘My’, ‘S’, ‘QL’) | 4 +———————————————————+ 5 | MySQL | 6 +———————————————————+ 7 1 row in set (0.00 sec)   CHAR_LENGTH 1 mysql> SELECT CHAR_LENGTH(“text”); 2 +———————————————————+ 3 | CHAR_LENGTH(“text”) | 4 +———————————————————+ 5 | 4 | 6 +———————————————————+ 7 1 row in set (0.00 sec)   Aggregate functions MySQL Aggregate functions is always very useful whenever we want to get the statistics of our data. We can calculate the average of all values, the sum of all values, and maximum & minimum values among certain groups of values. MySQL supports the following Aggregate functions; Let’s look at the example below on Aggregate functions; Suppose we have price listings for different groceries listed above, we will implement one of the aggregate functions on it. 1 +———–+—————————-+————–+—–+ 2 | groc_code | groc_name | groc_price 3 +———–+—————————-+————–+—–+ 4 | 1 |Little Steps Growing up Milk| 7.75 5 | 2 | Sacla Basil Pesto 190g | 2.50 6 | 3 | Golden Caster Sugar 500g | 1.30 7 | 4 | Higgidy Spinach & Pine Nut | 4.00 8 | 5 | Heinz Salad Cream 605g | 2.50   We will calculate the average of the groceries prices; 1 mysql> SELECT AVG(groc_price) AS price_ag FROM groceries; 2 +———-+ 3 | price_ag | 4 +———-+ 5 | 3.61 | 6 +———-+ 7 1 row in set (0.00 sec)   Date functions We have different Date and Time Functions in MySQL. A few out of these functions are listed below; An example of how to use CURDATE & DATE_ADD is shown below; CURDATE 1 mysql> SELECT CURDATE(); 2 -> ‘2022-04-21’ 3 mysql> SELECT CURDATE() + 0; 4 -> 20220421   DATE_ADD 1 mysql> SELECT DATE_ADD(‘2008-01-02’, INTERVAL 31 DAY); 2 -> ‘2008-02-02’ 3 mysql> SELECT ADDDATE(‘2008-01-02’, INTERVAL 31 DAY); 4 -> ‘2008-02-02’  

Blogs

Python Flask Tutorial: Build Your Flask Application

Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. It has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions. In this tutorial, we’ll show you how to write a basic python flask application and a step-by-step process on how to build it. Requirements Python: Python must be installed on your machine, and it’s recommended you use the latest version of Python. Flask supports Python 3.7 and newer. IDE: Must have an IDE to work with( VSCODE, Pycharm community IDE e.t.c.) Set up a Virtual Environment: You can set up your virtual environment based on the provided OS Specifications. macOS/Linux 1$ mkdir myproject 2$ cd myproject 3$ python3 -m venv venv Windows 1> mkdir myproject 2> cd myproject 3> py -3 -m venv venv   Activate Virtual Environment: Before working on your project, you must activate the corresponding environment macOS/Linux $ . venv/bin/activate   Windows > venv\Scripts\activate   Install Flask: After you have activated your environment, install flask with pip install flask Now, we’ll move to develop our web application Create an Hello World Flask Application In building a basic Flask app, we’ll create a simple hello world web app. We will do that by creating an app.py file and writing a function that returns an HTTP-based response. This Hello World Application shows us how to handle HTTP requests. Code The code below was used in creating our app.py file app.py 1# import our flask library 2from flask import Flask 3# create our app instance 4app = Flask(__name__) 5# we create our app route as /, we can use something else as well probably “/hello” [email protected](“/”) 7# we create our function hello here 8def hello(): 9# we assign the return value which is “hello world” 10 return “Hello World!” 11# this is to automatically run the app 12if __name__ == “__main__”: 13 app.run()   Running the Application We run our application by running ‘flask run’ . By default, flask runs a local server at port 5000. Web Interface On clicking http://127.0.0.1:5000/ by pressing the ctrl button down along with a click, it opens a web browser immediately as we can see below. Creating HTML templates We can as well use render_templates in flask to beautify our app. This render_template is used to generate output from a template file based on the Jinja2 engine that is found in the application’s templates folder. This makes managing our HTML codes easier. Now, we will create a folder called “templates” in the current folder we’re working with. Inside this newly created “templates” folder, all of our HTML files will reside there(index.html). Now let us create a basic HTML template. Note: The folder hierarchy will be in this order; todo |_ venv |_ app.py |_ templates |_____ index.html templates\index.html 1 2<!DOCTYPE html> 3<html> 4 5<head> 6 <title>My app test</title> 7</head> 8 9<body> 10<h2>Hello World</h2> 11 12<p>You’re welcome to my Blog!!!.</p> 13 14</body> 15 16</html   We’ll modify the code we have in our app.py file by importing render_template and also render our response as the Html file we just created. app.py Web Interface We have our app displayed as what we see here, whenever we click on the link http://127.0.0.1:5000/ 1from flask import Flask, render_template 2 3app = Flask(__name__) 4 5 [email protected](“/”) 7def index(): 8 return render_template(“index.html”) 9 10if __name__ == “__main__”: 11 app.run()  

Blogs

Python Classes and Objects

A class is a user-defined blueprint for creating Objects. When we create a new class, we also create a new object. We can also call class an object constructor for creating objects. An object can be defined as an instance of a class for which class acts as a blueprint for an object. For instance, we have species of birds that have certain attributes and we want to name 20 of them. Instead of creating a class for each bird, we just need to instantiate the multiple objects of that particular class. Like function begins with the def keyword when defining it, class definitions also begin with a class keyword. Create a Class A simple class Definition 1class MyStudents: 2 ”’This is a simple class definition”’ 3 pass Create an Object Creating an object of a class 1 Object_name= MyStudents() Class and Object Example Let’s check out this first example using a Bird specie as our class whereby we create an object of the Birds class as AsianGoose .We will use the object to call the function available in the class. 1class Birds: 2 “This is a person class” 3 feathers=”yes” 4 5 def Fly(self): 6 print(‘Flying’) 7 8 9# create a new object of Birds class 10AsianGoose = Birds() 11 12# Output: <function Birds.Fly> 13print(Birds.Fly) 14 15# Calling object’s Fly() method 16# Output: Flying 17print(AsianGoose.Fly())   The __init__() Method of Class Any double underscore before and after the variable and method are referred to as special variable and method in Python. e.g., So __name__ is a special variable, whereby __age__() is a special method. Whenever we use the __init__() method, it acts like constructor whereby on creating an object of the class, it automatically calls this method once. An example is implemented below on the init method of a class. In this example, we created a Class of MyStudent and define our constructor and as well use the self as the instance of the objects. We have access to the displayStudent function whenever we define the object of the class Mystudent, which allows us to have access to the name, and age parameter we defined. 1class MyStudent: 2 allStudent = 0 3 4 def __init__(self, name, age): 5 self.name = name 6 self.age = age 7 MyStudent.allStudent += 1 8 9 def displayStudent(self): 10 print(“Name:”, self.name, end=””) 11 print(“\tage:”, self.age) 12 13 14student1 = MyStudent(“Grace Jackson”, 15) 15student2 = STUDENT(“Sharon. Tyler”, 12) 16student3 = STUDENT(“Benson Kemony”, 16) 17 18student1.displayStudent() 19student2.displayStudent() 20student3.displayStudent() Hope you found this post helpful. Follow for more posts. Thanks for reading.

Blogs

How to Replace Data Source in a Report in Power BI

In this tutorial, we’ll be looking at how we can replace data source in a report in Power BI. Replacing Data Source in a report is common when we decide to alter our data source or probably we want to connect to an online data or a database which is different from the local CSV file or excel running on our machine. We have different approaches we can follow to achieve this which also rely on the type of data we want to replace it with. METHOD 1 Replacing Data with the Same Connector If the data we are connected to locally is an Excel or CSV file and we want to replace it with another file, we can do that by using the same connector. While at it we will ensure the new data has the same columns as the original one used in our report, otherwise it might result in an error. We can replace the data by clicking on File → Options and Settings → Data Source Settings. After clicking on Data Source Settings, it brings up the image below. Under Data Source Settings, select the Change Source button, which brings the Pop-up menu below. Click on the browse button to bring in the new file we want to replace within the report and then click Ok. METHOD 2 Replace data with a different data source connector Here, we want to replace our data with a new data source that is completely different from what is in the report. Let’s say we want to bring this data from SQL Server. We will show you the steps on how to go about that. Go to the home tab and navigate to the Transform Data by clicking on it which opens up the Power Query Editor. Under the Power Query Editor, click on New Source, which opens up a pop-up menu, for which you will locate the database you want to connect to. For us, we’ll be connecting to SQL Server database. After clicking on SQL Server it opens up a new pop up menu to pass our credentials and then we connect. The navigator page is shown below to select the table we want to replace with in our report. We will click on the table and then select OK. This brings us to a new page as seen below. The new data we brought in now is the newfirst_data table which is to replace ListOfOrders table. Now, we can see that the data has been selected. Click on Advanced Editor. This Advanced Editor is where we are to perform the major work on replacing the data. After the Editor has opened, we will copy what we highlighted in the image below. This code we copied will be pasted inside our original data Advanced editor. Now let’s do that. Click on our original data (ListOfOrders) and as well open its Advanced Editor. The code highlighted above will be replaced with the code we copied earlier, so we have the Advanced Editor as shown below. Then, we will click Done, whereby the data we brought in from SQL Server has been replaced with the former we had in our report. We can see the ListOfOrders Data Table has changed as shown below. And that’s a wrap. I hope you enjoyed this post! Thanks for reading.

Blogs

How to Use Inheritance in Python

Photo by Nubelson Fernandes on Unsplash Inheritance is referred to as the act of inheriting something or when it’s passed down to someone else. In this tutorial, we’ll be looking at what inheritance is in Python. That is, how we can use it and how it’s being created. Inheritance in Python is the ability of a class to acquire or inherit properties from another class. The class it inherits is called base (or parent class) and the new class is called derived (or child) class. The capability to inherit properties from another class helps to promote the reusability of code, whereby we don’t repeat code we’ve written earlier. Inheritance is also known as a powerful feature in object-oriented programming. We’ll demonstrate different examples of how we can use inheritance in Python. Single Inheritance In Single inheritance, this is how a class can inherit from only a single parent class of which it has access to properties of the base class. In the example below, we will demonstrate a basic example of how (we) a Student class is inheriting from the base class(Persons), which gave it access to elements in the base class. 1class Person: 2 def __init__(self, firstName, lastName): 3 self.fname=firstName 4 self.lname=lastName 5 6 def printname(self): 7 print(self.fname, self.lname) 8 9 10class Student(Person): 11 pass 12user = Student(“Mike”, “Johnson”) 13user.printname() 14#Result 15Mike Johnson Multiple Inheritance Multiple Inheritance refers to how a class inherits from more than one base class and all features of the base classes are inherited into the derived class. This type of inheritance is called multiple inheritance. In this example, we demonstrated with a bio-data information whereby we have 2 different base classes (Name, Age), which the Bdata inherited from and it also gain access to functions of both classes. 1# Base class1 2class Name: 3 PName = “” 4 def Name(self): 5 print(self.PName) 6 7# Base class2 8class Age: 9 Agevalue = “” 10 def Age(self): 11 print(self.Agevalue) 12 13# Derived class 14class BData(Name, Age): 15 def userData(self): 16 print(“Name :”, self.PName) 17 print(“Age :”, self.Agevalue) 18 19the_data = BData() 20the_data.PName = “Grace” 21the_data.Agevalue = “15” 22the_data.userData() 23 1#Result 2Name : Grace 3Age : 15 We have another example below, where we have the Base class ‘Intern’, ‘FullWorker’  and also a child class TeamLeader  which inherits the 2 base class ( ‘Intern’, ‘FullWorker’ ) and gets to access all properties and elements of each of those classes. 2# Parent class 1 3class Intern(object): 4 def __init__(self, name): 5 self.name = name 6 7# Parent class 2 8class FullWorker(object): 9 def __init__(self, salary, jobtitle): 10 self.jobtitle = jobtitle 11 self.salary = salary 12 13# Deriving a child class from the two parent classes 14class TeamLeader(Intern, FullWorker): 15 def __init__(self, name, jobtitle, salary, experience): 16 self.experience = experience 17 Intern.__init__(self, name) 18 FullWorker.__init__(self, salary, jobtitle) 19 print(“Name: {}, Pay: {}, Exp: {}”.format(self.name, self.salary, self.experience)) 20 21the_teamlead = TeamLeader(‘Bill’,’Data Engineer’, 300000, 4) 1#Result 2Name: Bill, Pay: 300000, Exp: 4   Thanks for reading this article. Feel free to drop your comments and questions in the comments section below.

Blogs

Range Function in Python

Photo by AltumCode on Unsplash The range() method in Python is usually used to return a fixed set of numbers between a given start integer to the end of an integer. We can have numbers like 0, 1, 2, 3, and 4, which is very useful since the numbers can be used to index into collections such as strings. The Syntax of the Range Function The range() function takes in three arguments(start, step, and stop), whereby we have two of these arguments that are optional(start and step) and the mandatory one is the stop. range(start, stop[, step]) We’ll demonstrate further how to use Range in the different examples below. a. Generate Numbers with For Loop using One Parameter We will implement a for loop by using only one parameter value (stop). Now, let’s find the range of numbers within 0 to 7 range, this should return 0 to 6. We might discover we have results showing 0, 1, 2, 3, 4, 5, and 6. The reason for this is that the range function does exclude the last value when computing its result. 1for i in range(7): 2 print(i) Result 10 21 32 43 54 65 76 b. Generate Numbers with For Loop using Two Parameters Now, we’ll generate numbers by using For loop with two parameters value(start and stop). Here, we have no step value. 1for i in range(1,5): 2 print(i) 3 4 Result 11 22 33 44 c. Reversed Range The reversed function can be used with Range to perform the operation from the back. It is also possible to use positive or negative numbers as parameters in the range. 1for i in range(5, 1, -1): 2 print(i) Result 15 24 33 42 Another Example 1s = ‘Python’ 2len(s) 3 4for i in reversed(range(len(s))): 5 print(i, s[i]) Result 15 n 24 o 33 h 42 t 51 y 60 P d. How to create List, Tuple, and Set with Range The range function is also applicable to use with other different methods whereby we have the list, set, and tuple. List 1print(list(range(0, 20, 5))) Result 1[0, 5, 10, 15] Tuple 1print(tuple(range(0, 20, 5))) Result 1(0, 5, 10, 15) Set 1print(set(range(0, 20, 5))) Result 1{0, 10, 5, 15}

Blogs

Tableau Dashboard Parameter Actions

In this tutorial, we’ll look at how to use Tableau dashboard parameter actions. We know Parameters as containers of values used to calculate and enter values not present in the original dataset which can be workbook variables like dates, a string of text, numbers, or calculated fields. We can use the Parameter Actions in Tableau Desktop version 2019.2 upwards, which gives users the ability to change parameter values even more easily. We will demonstrate by using the Superstore dataset. Step 1 Open Tableau on your computer, bring in your Superstore Dataset and open a new worksheet. Go to the top left corner by clicking the small arrow to select create Parameters in order to start off with what we need to do. The type of Parameter we’ll be creating is a float data type format that accepts values from users. The function responsible for that is the Allowable values we can see in the image below. Step 2 The next thing to do is to drag the Parameter to the Marks card under the text because we want to change the current values based on our selection. From what we could see in the image below, we found out that we have the Dollar currency as well. This was added by right-clicking and clicking on format. Go to Fields → Pane → Numbers, select the currency(standard) and select English(United States) as the Locale. Step 3 Next, we will create another chart in a new worksheet to calculate the Sales by Month. Drag the Order Date(change the view to month) and the Sales into the Pane. We can edit the Axis Pane to be in currency format by right-clicking and selecting Format. Then click on Axis → Numbers → Scale to change to standard US currency format. After this, we will place both worksheets in a dashboard to go further with our Parameter Actions. Step 4 To add a Parameter Action, we will click Dashboard in the top menu and then Actions. Click on the Add Action button and select Change Parameter among the options. After clicking Change Parameter, tick the sheet to our sales by month(Sheet 2) and select our Parameter as the target Parameter and the Sales with sum Aggregate as the Source Field. We then have control of the source sheet of the action, whereby whenever we click on the line graph, the Sales value is Overwritten in our my_param Parameter we created, just as what we have below.

Scroll to Top