Forum Discussion
Year to date average
- 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 :-)
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 :-)
Hello,
Am very new to Power BI and i got requirement to calculate YTD. i followed the same steps to calculate YTD.. in my Table i have three columns(two columns are unpivoted columns, like success, error, all respective vaues for the same) Other column is list of months.. i have to calculate YTD of Vaues..
i have craeted one Date Table with one column which contains date frmo 01/01/2017 to 31/12/2017.
then i created one calculated column which is of the data type date respectively for each month, and i hvae careted the relationship between them,
now i have to create the Measure,
requirement is just need to add the values of different attribute respective of month and its previous months value..
am bit confused how to calculate the measure
Duration Billable Pct =
DIVIDE(
CALCULATE(
SUM( YourData[Duration] ),
YourData[Category] = "billable"
),
CALCULATE(
SUM( YourData[Duration] ),
ALL( YourData[Category] )
)
)