Text statements are often needed in report dashboards to describe or summarize data.
For example, you want to display the total number and total cost of branches, and the name and cost of the branch with the highest cost in FineBI, as shown in the following figure. In this case, you can use the KPI card.
Use the TOTAL function to calculate the number and the total cost of branches.
Add a filter condition to the Cost field to filter out the branch with the highest cost.
Sample data: Logistics Profit Data.xlsx
To calculate the total number of branches and display the result with a KPI card, TOTAL and COUNTD_AGG are needed.
Select the Logistics Profit Data table and add a component. Click Add Calculation Indicator, set Field Name, and enter the formula TOTAL(COUNTD_AGG(Branch Office),0,"sum"), as shown in the following figure.
Formula explanation:
The COUNTD_AGG function is used to perform a distinct count on branch names, the result of which is summed up through the TOTAL function as the number of branches.
To calculate the total cost and display the result with a KPI card, TOTAL and SUM_AGG are needed.
Click Add Calculation Indicator, enter Field Name, and enter the formula TOTAL(SUM_AGG(Cost),0,"sum"), as shown in the following figure.
To display the total number and cost of branches with a KPI card, click KPI Indicator Card and drag Number of Branches and Total Cost into the Text bar, as shown in the following figure.
Click Text to modify the data display format, as shown in the following figure.
The effect is shown in the following figure.
To display the name and cost of the branch with the highest cost, you can add a filter condition.
Drag Branch Office and Cost into the Text bar. By doing so, the name and total cost of each branch appear in the KPI card component, as shown in the following figure.
To retain only the data of the branch with the highest cost, you can filter the Cost field and set the filter condition to Largest N (N = 1) of Cost, as shown in the following figure.
Deselect the Secondary Calculation option of Number of Branches and Total Cost, as shown in the following figure.
Set the text format of the KPI card, as shown in the following figure.
For the demonstration of this KPI card, see section "Preview."
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy