In this article, we will show you, How to create and configure the Linear Gauges in SSRS. For this, We are going to use the below-shown report.
Please refer to SSRS Table Report, Data Source and Dataset articles to understand the creation of Data Source, Dataset and Table report. If you observe the below screenshot, It was a normal Table report with Country Name, Sales and Number of Orders columns.
-- Data to create Linear Gauge in SSRS SELECT [SalesTerritoryCountry] ,SUM ([OrderQuantity])AS ORDERS ,SUM ([SalesAmount])AS [TOTAL SALES] FROM [DimSalesTerritory] INNER JOIN FactInternetSales ON [DimSalesTerritory].SalesTerritoryKey = FactInternetSales.SalesTerritoryKey GROUP BY [SalesTerritoryCountry] ORDER BY [SalesTerritoryCountry]
Creating Linear Gauges in SSRS
In this example, We will create and add the Linear Gauges on the right-hand side of the Orders column So, First, create an Empty column by right-clicking on the Orders column and select the Insert Column option and then select the Right option.
Next, Drag and drop the Drop the Gauges from Toolbox to the Empty column. When you drag and Drop the Gauges from Toolbox to the Empty column, a new window called Select Gauges Type will be opened to select required Gauges (Radial and Linear) from the available once.
In this example, we are selecting Simple Linear Gauges as shown in below screenshot.
Click Ok to add Linear Gauge to a newly created empty cell. Now, we have to configure the Gauges Data. First, Click on the Linear Gauge will open the Gauge Data window. In this example, we want to show the Linear Pointer for Total Sales so, Please drag and drop or select the orders as the Indicator Value.
NOTE: Please be careful when dragging the columns to values region, if you mishandled or dropped in design area will end up in mess.
Range Properties in Linear Gauges in SSRS
If you observe the above screenshot, Range is starting at 60 (Middle of the Scale) and end at 100. Let us make it more meaningful by Right Click on the Range will open the context menu. Please select the Range Properties.. option from it as shown in below screenshot.
To add the Range, Please refer Adding Ranges section in Gauges in SSRS article.
Once you select the Range Properties.. option, a new window called Linear Scale Range Properties will be opened to configure the Range scale. We ahave already explained the properties and their Default values of a Range in Gauges article.
Here, we kept the starting position to 0 and are changing end position to Sum (Total Sales). It means Range will start at 0 and finish at Sum of Total Sales of each individual Territory.
SSRS Linear Gauge Scale Properties
Next, we have to configure the Scale Properties of a Linear Gauge so, Right Click on the Scale will open the context menu. Please select the Scale Properties option from it.
Once you select the Scale Properties option, a new window will be opened to configure the Linear Gauge Scale. From the General tab, you can notice the default Minimum and Maximum values of a Linear gauge scale.
Here, we are changing the minimum value to 1500000 and maximum value to 9500000 because our values are between these two values. You also use the fx button for custom expressions.
NOTE: You can also customize the intervals between Minimum and Maximum value using the Interval property.
Next, We formatted the Number to currency, removed the decimal values and asked the reporting server to display values in thousands. It means 1500000 will be displayed as $1500
Click Ok to finish configuring the Linear gauge properties. Lets see the Report preview by clicking on the preview tab
If you observe the above screenshot, It is giving a perfect result but the range is starting beyond the starting point (1500000).
This is because, We set the Range Starting value to 0 at the beginning. Let us change the range starting value to 1500000 as shown below
Click Ok to finish and click on the preview tab
If you observe the above screenshot, It looks neat and clean.
Thank you For Visiting Our Blog