powerbidaxburndowncharts

DAX: How do i create a table for a burndown chart? What status was current on certain dates


I'm creating a dashboard for a sprint overview and want to visualize the progress of the team in a burndown chart. The chart should give information about the amount of user stories that are each new, active and closed. So that in the beginning all user stories are open, then they become active and in the end, there are no open and active stories left.

Now my problem is in modeling the data using DAX. The data is stored in a big table with a row for each user story that contains all the information on that date. Now, if the information gets modified like in the event of changing the status from new to active or correcting a spelling mistake, the program just adds a new row with a new date.

like in here

The table I want should have the columns date, new, active, and closed. For the date column i have written the following code:

 CALENDAR(
    FIRSTNONBLANK(
        CurrentIterations[StartDate];
        CurrentIterations[StartDate] );
    FIRSTNONBLANK(
        CurrentIterations[FinishDate];
        CurrentIterations[FinishDate])
    )

But now, oriented on that dates i want the other columns to calculate themselves. In every row I want the amount of user stories in the original table that are active and the latest version on that date.

Examples:

Original table

original table

Wanted table

wanted table

Wanted burndown chart

wanted burndown chart

Any help greatly appreciated!


Solution

  • Here's another approach.

    Calculated table:

    MaxRev = CROSSJOIN(VALUES(Test[Id]), VALUES(Test[Date]))
    

    Add the following calculated columns to this table:

    MaxRev = CALCULATE(MAX(Test[Rev]),
                 FILTER(Test, Test[Id] = MaxRev[Id] && Test[Date] <= MaxRev[Date]))
    
    Status = LOOKUPVALUE(Test[State], Test[Id], MaxRev[Id], Test[Rev], MaxRev[MaxRev])
    

    Then use this to create a new calculated table:

    Wanted = SUMMARIZE(MaxRev, MaxRev[Date],
                "New", CALCULATE(COUNT(MaxRev[Id]), MaxRev[Status] = "New") + 0,
                "Active", CALCULATE(COUNT(MaxRev[Id]), MaxRev[Status] = "Active") + 0,
                "Solved", CALCULATE(COUNT(MaxRev[Id]), MaxRev[Status] = "Solved") + 0)