Data source is updated weekly and new Work Week (WW) availability data is added for each machine. A machine is deemed 'Pass' if the availability for that week is > 90%. I calculate the 'Pass' measure as below.
Pass count for each machine for each week, displayed in a matrix, looks like this (given above data):
Now, I want to calculate some figures for these pass values for each machine. My actual needs are a bit complex, but few of the most basic things I wanted calculated are shown below.
New Pass Number of total machines for each week that passed, but failed previous week.
New Fail Number of total machines for each week that failed, but passed previous week.
Steady Number of total machines for each week that the condition didn't change.
To better illustrate, I put my desired results in an Excel file:
As mentioned at the beginning of the post, my source CSV is updated with new data each week, so as time goes on I will have more [WW] columns added in my PowerBI matrix. Given this I don't quite know how I can calculate the above values dynamically without hardcoding anything. Is this possible?
Here is one way to do this one to get the result below.
First you need to add a column in query or with a DAX column to get the weeknumber as an integer. You can then use these measure expressions (they differ only in the Return part). The IF in the Return of the New Pass measure is to prevent a result of 2 showing in WW35.