Forum Discussion
gsc-nvr
5 years agoFrequent Visitor
Modifying bi-weekly data to be weekly
Hi folks, brand new user of Power BI here with a question I can't search an answer for. I have a table of salary hours which reports by payroll period (every two weeks), while all my other data (...
- 5 years ago
Thank you lbendlin for pointing me in the direction of a date table - that helped solve part of the puzzle. Using a date table and the below measure, I was able to smooth out my salary hours across two weeks as desired.
SalaryHours Smoothed = if( ISBLANK(SUM(SalaryHours[Hours])), CALCULATE( DIVIDE(SUM(SalaryHours[Hours]),2), DATEADD('Calendar'[Date],-7,day) ), DIVIDE(SUM(SalaryHours[Hours]),2) )
gsc-nvr
5 years agoFrequent Visitor
Thank you lbendlin for pointing me in the direction of a date table - that helped solve part of the puzzle. Using a date table and the below measure, I was able to smooth out my salary hours across two weeks as desired.
SalaryHours Smoothed =
if(
ISBLANK(SUM(SalaryHours[Hours])),
CALCULATE(
DIVIDE(SUM(SalaryHours[Hours]),2),
DATEADD('Calendar'[Date],-7,day)
),
DIVIDE(SUM(SalaryHours[Hours]),2)
)