Forum Discussion
aashton
Helper V
1 year agoDATEDIFF with SUM not working
In Power BI I've created a table with Pay Period Start Date, Pay Period End DAte, Check Date. I have a calculated column to find the number of days in a pay period ( I tried a million variations of...
aashton
Helper V
1 year agoThe code to create the table is, don't know if that affects anything:
Pay Periods Bi-weekly =
VAR StartDate = DATE(2024, 1, 1)
VAR EndDate = DATE(2025, 12, 31)
VAR PayPeriodStart = DATE(2024, 5, 5)
VAR PayPeriodLength = 14
VAR NumberOfDays = DATEDIFF(StartDate, EndDate, DAY)
RETURN
ADDCOLUMNS(
CALENDAR(StartDate, EndDate),
"PayPeriodStart",
VAR CurrentDate = [Date]
RETURN PayPeriodStart + PayPeriodLength * INT((CurrentDate - PayPeriodStart) / PayPeriodLength),
"PayPeriodEnd",
VAR CurrentDate = [Date]
RETURN PayPeriodStart + PayPeriodLength * INT((CurrentDate - PayPeriodStart) / PayPeriodLength) + PayPeriodLength - 1
)