Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Value by Week Measure KPI

Hi all,

 

I believe this dilemma is solvable by DAX, but I don't have enough experience to solve it myself.

 

We have data that comes in by date, item, and scheduled and produced amounts. If an item is over or under-produced, it does not meet the KPI (between 95% and 105%).

 

In simplest terms, I need a measure which will compare the number of items which made KPI by week by the total number of items worked on by week.

 

Here is a sample table:

Item123A 123B 123C 
WeekProduction AccuracyKPI MetProd. Acc.KPI MetProd. Acc.KPI Met
194%No (0)90%No (0)101%Yes (1)
2104%Yes (1)95%Yes (1)102%Yes (1)
399%Yes (1)  103%Yes (1)
Total99%66% (2/3)92.5% 50% (1/2)102%100% (3/3)

 

Total KPI Met for above table: 6 met over 8 overall, 6/8, 75%.

 

Getting the production accuracy measure was pretty simple, but getting the KPI Met measure has proved tricky since it has to remain consistent when being rolled up to month, year, and a lot of different categories (work station, item category, etc).

 

If more clarification is needed please let me know. Thank you.

1 REPLY 1
mahoneypat
Microsoft Employee
Microsoft Employee

It would be better to share your example table and an example of correct results.  Here is a measure expression pattern that may work.

 

Avg Weekly KP Met =
VAR vSummary =
    ADDCOLUMNS (
        DISTINCT ( Date[Week] ),
        "cCount",
            CALCULATE (
                COUNTROWS ( Table )
            ),
        "cKPIMet",
            CALCULATE (
                COUNTROWS ( Table ),
                FILTER (
                    ALL (
                        Table[Scheduled],
                        Table[Produced]
                    ),
                    Table[Produced] >= 0.95 * Table[Scheduled]
                        && Table[Produced] <= 1.05 * Table[Scheduled]
                )
            )
    )
RETURN
    AVERAGEX (
        vSummary,
        [cKPIMet] / [cCount]
    )

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (25)