You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Power BI中按生效年份统计Rater/Walkaway工具占比的带百分比卡片条形图实现方法

Alright, let's walk through exactly how to build this report—assuming you're using Power BI (the go-to tool for slicer-driven visualizations like this). Here's a step-by-step breakdown:

Step 1: Validate Your Data Structure

First, make sure your table is loaded correctly with the right data types:

  • 唯一提交编号: Set to integer/text (ensure no duplicates, since this is your unique ID)
  • Tool Indicator: Text type (values: Yes/No)
  • Tool Type: Text type (values: Rater/Walkaway/Null)
  • Effective year: Integer/date type (so the year slicer works smoothly)
Step 2: Create DAX Measures for Dynamic Calculations

You'll need 3 core measures to calculate percentages that update with your year slicer selection:

Total Submissions

Total Submissions = DISTINCTCOUNT('Your Table Name'[唯一提交编号])

Why DISTINCTCOUNT? It ensures each unique submission is counted only once, even if there are accidental duplicates in your data.

Rater Tool Percentage

Rater % = 
VAR RaterSubmissions = CALCULATE(DISTINCTCOUNT('Your Table Name'[唯一提交编号]), 'Your Table Name'[Tool Type] = "Rater")
VAR Total = [Total Submissions]
RETURN DIVIDE(RaterSubmissions, Total, 0)

This measure filters for only Rater-associated submissions, then divides by total submissions. DIVIDE avoids errors if total submissions are zero.

Walkaway Tool Percentage

Walkaway % = 
VAR WalkawaySubmissions = CALCULATE(DISTINCTCOUNT('Your Table Name'[唯一提交编号]), 'Your Table Name'[Tool Type] = "Walkaway")
VAR Total = [Total Submissions]
RETURN DIVIDE(WalkawaySubmissions, Total, 0)

Same logic as the Rater measure—just filters for Walkaway instead.

Step 3: Set Up Your Slicers
  • Drag Effective year onto your canvas, select the Slicer visual, and set it to your preferred selection mode (single-select, dropdown, etc.).
  • Optional: Add Tool Indicator and Tool Type slicers if you want extra filtering control. By default, slicers will automatically filter all visuals on the page.
Step 4: Build the Bar Chart + Percentage Cards

You have two solid options here, depending on your preferred layout:

Option 1: Bar Chart + Separate Percentage Cards

  1. Build the Bar Chart:

    • Drag Tool Type to the Axis (right-click it > Filter to exclude Null values, so only Rater/Walkaway show up)
    • Drag both Rater % and Walkaway % to the Values field. Switch to a Clustered Bar Chart for clear side-by-side comparison.
    • Format the Y-axis to show percentages (go to Format > Y-axis > Display units > Percentage)
  2. Add Percentage Cards:

    • Drag Rater % and Walkaway % onto the canvas as separate Card visuals.
    • Format each card to display percentages (go to Format > Data label > Display units > Percentage, and adjust decimal places as needed)
    • Position the cards above or next to the bar chart—they’ll automatically update when you select a year in the slicer.

Option 2: Bar Chart with Inline Percentage Labels

If you don’t want separate cards, you can embed percentages directly on the bars:

  1. Create the bar chart as described in Option 1.
  2. Go to Format > Data labels and toggle them on.
  3. Set the label value to Value (your percentage measures) and format it to show percentages.
  4. Optional: Add a single card for Total Submissions to give context to the percentages.
Step 5: Tweak Interactions (If Needed)

Double-check that your slicers are filtering all visuals:

  • Click the Effective year slicer, then go to Format > Edit interactions
  • Ensure the bar chart and cards have the Filter icon enabled (not the None icon)

If you’re using a different tool like Tableau, the core logic is the same: create calculated fields for the percentages, set up a year filter, and build your visuals. Power BI is just the most common tool for this use case.


内容的提问来源于stack exchange,提问作者katy89

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:50:51