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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.