Forum Discussion

greemlin's avatar
greemlin
Frequent Visitor
9 years ago
Solved

Year to date average

Hi, I'm a recent user of PowerBI, and I have a question to build a report based on the Billable activities VS non Billable activities I've got the source as follow with the date of the activity, ...
  • BetterCallFrank's avatar
    9 years ago

    Hey Nicolas,

     

    this apporach should work fine for you:

     

    1) create a Date table without "holes" - prerequisite for the time intelligence to work properly

        easiest way is to create a calculated table with the pattern

    Date = CALENDAR( MIN( YourData[Start Date] ), MAX( YourData[Start Date] ) )

    2) create a relationship between your data and the new date table

     

    3) create a Measure that calculates the percentage for a given month:

      for example:

    Duration Billable Pct = 
    DIVIDE(
      CALCULATE(
        SUM( YourData[Duration] ),
        YourData[Category] = "billable"
      ),
      CALCULATE(
        SUM( YourData[Duration] ),
        ALL( YourData[Category] )
      )
    )

     

    4) create a Measure that will give you the YTD/Running total of that Percentage, for example:

      

    Duration Billable Pct YTD = TOTALYTD( [Duration Billable Pct], 'Date'[Date] )

     

    Should result in sth like this:

     

     

    Give it a try and let me know if it helps :-)