You see an empty table displaying only the column headers for the selected element. For better visibility, enlarge the visualization.
In the Filters pane:
Select the daterange is (All) from Filters on this visual.
Select Relative date as the Filter type.
Define the filter to Show items when the valueis in the last1calendar years.
Select Apply filter.
You see the table updated with the applied daterange filter.
In the Visualization pane:
Use
to remove daterange from Columns.
Drag and drop Sum of purchases_revenue underneath Sum of purchases in Columns.
On the Table visualization:
Select Sum of purchase_revenue to sort the product names in descending purchase revenue order. Your Power BI Desktop should look like below.
In the Filters pane:
Select product_name is (All).
Set Filter type to Top N.
Define the filter to Show itemsTop10By value.
Drag and drop purchase_revenue into By valueAdd data fields here.
Select Apply filter.
You see the table updated with values for purchase revenue in sync with the Freeform table visualization in Analysis Workspace.
In the Visualizations pane:
Select the Line and stacked column chart visualization.
A line and stacked column chart visualization replaces the table while using the same data as the table.
Drag and drop purchases onto Line y-axis in the Visualizations pane.
The line and stacked column chart is updated. Your Power BI Desktop should look like below.
On the Line and stacked column chart visualization:
Select
.
From the context menu, select Show as a table.
The main view is updated to show both a line visualization and a table.
Tableau Desktop
Select the Sheet 1 tab at the bottom to switch from Data source. In the Sheet 1 view:
Drag the Daterange entry from the Tables list in the Data pane and drop the entry onto the Filters shelf.
In the Filters Field [Daterange] dialog, select Range of Dates and select Next >.
In the Filter [Daterange] dialog, select Range of dates and specify a period of 01/01/2023 - 31/12/2023. Select Apply and OK.
Drag and drop Product Name from the Tables list in the Data pane and drop the entry in the field next to Rows.
Drag and drop Purchases from the Tables (Measure Names) list in the Data pane and drop the entry in the field next to Rows. The value is automatically converted to SUM(Purchases).
Drag and drop Purchase Revenue from the Tables (Measure Names) list in the Data pane and drop the entry in the field next to Columns and left from SUM(Purchases). The value is automatically converted to SUM(Purchase Revenue).
To order both charts in descending purchase revenue order, hover over the Purchase Revenue title and select the sort icon.
To limit the number of entries in the charts, select SUM(Purchase Revenue) in Rows and from the drop-down menu select Filter.
In the Filter [Purchase Revenue] dialog select Range of values and enter appropriate values. For example: 1,000,000 - 2,000,000. Select Apply and OK.
To convert the two bar charts to a dual combination chart, select SUM(Purchases) in Rows and from the drop-down menu, select Dual Axis. The bar charts transform into a scatter plot.
To modify the scatter plot to a bar chart:
Select SUM(Purchases) in the Marks area and select Line from the drop-down menu.
Select SUM(Purchase Revenue) in the Marks area and select Bar from the drop-down menu.
Your Tableau Desktop should look like below.
Select Duplicate from the Sheet 1 tab context menu to create a second sheet.
Select Rename from the Sheet 1 tab context menu to rename the sheet to Data.
Select Rename from the Sheet 1 (2) tab context menu to rename the sheet to Graph.
Ensure that the Data sheet is selected.
Select Show me at the top right and select Text table (upper left top visualization) to modify the content of the two charts to a table.
To order purchase revenue in descending order, hover over Purchase Revenue in the table and select
.
Select Entire View from the Fit drop-down menu.
Your Tableau Desktop should look like below.
Select New Dashboard tab button (at the bottom) to create a new Dashboard 1 view. In the Dashboard 1 view:
Drag and drop the Graph sheet from the Sheets shelf onto the Dashboard 1 view that reads Drop sheets here.
Drag and drop the Data sheet from the Sheets shelf below the Graph sheet onto the Dashboard 1 view.
Select the Data sheet in the view and modify Entire View to Fix Width.
Your Dashboard 1 view should look like below.
Looker
In the Explore interface of Looker, ensure you do have a clean setup. If not, select
Remove fields and filters.
Select + Filter underneath Filters.
In the Add Filter dialog:
Select ‣ Cc Data View
From the list of fields, select ‣ Daterange Date then Daterange Date.
Specify the Cc Data View Daterange Date filter as is in range2023/01/01until (before)2024/01/01.
From the ‣ Cc Data View section in the left rail, select Product Name.
From the ‣ Custom Fields section in the left rail:
Select Custom Measure from the + Add drop-down menu.
In the Create custom measure dialog:
Select Purchase Revenue from the Field to measure drop-down menu.
Select Sum from the Measure type drop-down menu.
Enter a custom field name for Name. For example: Purchase Revenue.
Select the Field details tab.
Select Decimals from the Format drop-down menu and ensure 0 is entered in Decimals.
Select Save.
Select Custom Measure once more from the + Add drop-down menu. In the Create custom measure dialog:
Select Purchases from the Field to measure drop-down menu.
Select Sum from the Measure type drop-down menu.
Enter a custom field name for Name. For example: Sum of Purchases.
Select the Field details tab.
Select Decimals from the Format drop-down menu and ensure 0 is entered in Decimals.
Select Save.
Both fields are automatically added to the Data view.
Select + Filter to add another Filters and to limit the data.
In the Add Filter dialog, select ‣ Custom Fields, then Purchase Revenue.
Make the appropriate selections and enter the proposed values, so the filter reads is between inclusive1000000AND2000000.
Select Run.
Select ‣ Visualization to display the line visualization.
Select Edit in Visualization to update the visualization. In the popup dialog:
Select the Series tab.
Scroll down to see Purchases and change the Type to Line.
Select the Y tab.
Drag Purchases from the **Left 1 ** container to where it reads Drag series here to create a new left axis. This action creates a Left 2 container.
Select
next to Edit to hide the popup dialog
You should see a visualization and table similar as shown below.
Jupyter Notebook
Enter the following statements in a new cell.
code language-none
import seaborn as sns
import matplotlib.pyplot as plt
data = %sql SELECT product_name AS `Product Name`, SUM(purchase_revenue) AS `Purchase Revenue`, SUM(purchases) AS `Purchases` \
FROM cc_data_view \
WHERE daterange BETWEEN '2023-01-01' AND '2024-01-01' \
GROUP BY 1 \
LIMIT 10;
df = data.DataFrame()
df = df.groupby('Product Name', as_index=False).sum()
plt.figure(figsize=(15, 3))
sns.barplot(x='Purchase Revenue', y='Product Name', data=df)
plt.show()
display(data)
Execute the cell. You should see output similar to the screenshot below.
RStudio
Enter the following statements between ```{r} and ``` in a new chunk.