Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I need to get hit rate, I wrote a measure but it seems like too much data to show in the BI matrix table..
all my data is about 30,000 rows, data structure is like excel picture
maybe someone can solve it with better solution...?
step 1: rolling total qty evey 3 months GROUP BY SALES AND PARTNO IN TABLE A AND B
step 2: new_ship_qty/new_forcast_qty*100% ---> get hit rate.
TABLE A
| sales | partmo | Forcast_QTY | YYMMDD |
| Harris | 00A | 1 | 2023/12/1 |
| Harris | 00A | 2 | 2024/1/1 |
| Harris | 00A | 3 | 2024/2/1 |
| Harris | 00A | 4 | 2024/3/1 |
| Harris | 00A | 3 | 2024/4/1 |
| Harris | 00B | 5 | 2024/1/1 |
| Harris | 00B | 1 | 2024/2/1 |
| Harris | 00C | 6 | 2024/1/1 |
| Harris | 00C | 7 | 2024/2/1 |
| Harris | 00C | 4 | 2024/3/1 |
| Harris | 00C | 1 | 2024/4/1 |
| Harris | 00C | 5 | 2024/5/1 |
| Harris | 00C | 6 | 2024/6/1 |
| Albee | 00A | 9 | 2023/12/1 |
| Albee | 00A | 7 | 2024/1/1 |
| Albee | 00A | 8 | 2024/2/1 |
| Albee | 00A | 8 | 2024/3/1 |
| Albee | 00B | 8 | 2024/2/1 |
| Albee | 00B | 4 | 2024/3/1 |
---->
NEW TABLE A
| sales | partmo | NEW_Forcast_QTY | YYMMDD |
| Harris | 00A | 1 | 2023/12/1 |
| Harris | 00A | 3 | 2024/1/1 |
| Harris | 00A | 6 | 2024/2/1 |
| Harris | 00A | 9 | 2024/3/1 |
| Harris | 00A | 10 | 2024/4/1 |
| Harris | 00B | 5 | 2024/1/1 |
| Harris | 00B | 6 | 2024/2/1 |
| Harris | 00C | 6 | 2024/1/1 |
| Harris | 00C | 13 | 2024/2/1 |
| Harris | 00C | 17 | 2024/3/1 |
| Harris | 00C | 12 | 2024/4/1 |
| Harris | 00C | 10 | 2024/5/1 |
| Harris | 00C | 12 | 2024/6/1 |
| Albee | 00A | 9 | 2023/12/1 |
| Albee | 00A | 16 | 2024/1/1 |
| Albee | 00A | 24 | 2024/2/1 |
| ….... |
TABLE B
| sales | partmo | Ship_QTY | YYMMDD |
| Harris | 00A | 3 | 2023/12/1 |
| Harris | 00A | 2 | 2024/1/1 |
| Harris | 00A | 5 | 2024/2/1 |
| Harris | 00A | 6 | 2024/3/1 |
| Harris | 00A | 6 | 2024/4/1 |
| Harris | 00B | 7 | 2024/1/1 |
| Harris | 00B | 2 | 2024/2/1 |
| Harris | 00C | 10 | 2024/1/1 |
| Harris | 00C | 9 | 2024/2/1 |
| Harris | 00C | 6 | 2024/3/1 |
| Harris | 00C | 7 | 2024/4/1 |
| Harris | 00C | 3 | 2024/5/1 |
| Harris | 00C | 3 | 2024/6/1 |
|
---->
NEW TABLE B
| sales | partmo | NEW_Ship_QTY | YYMMDD |
| Harris | 00A | 3 | 2023/12/1 |
| Harris | 00A | 5 | 2024/1/1 |
| Harris | 00A | 10 | 2024/2/1 |
| Harris | 00A | 13 | 2024/3/1 |
| … |
@iamJL First, create measures to calculate the rolling 3-month total for both forecast and ship quantities.
RollingForecastQTY =
CALCULATE(
SUM('TableA'[Forcast_QTY]),
DATESINPERIOD('TableA'[YYMMDD], LASTDATE('TableA'[YYMMDD]), -3, MONTH)
)
RollingShipQTY =
CALCULATE(
SUM('TableB'[Ship_QTY]),
DATESINPERIOD('TableB'[YYMMDD], LASTDATE('TableB'[YYMMDD]), -3, MONTH)
)
Next, create a measure to calculate the hit rate based on the rolling totals.
HitRate =
DIVIDE(
[RollingShipQTY],
[RollingForecastQTY],
0
) * 100
Add the HitRate measure to your BI matrix table to visualize the hit rate over time.
Proud to be a Super User! |
|
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 21 | |
| 10 | |
| 8 | |
| 8 |