Forum Discussion
bice_cold
7 years agoFrequent Visitor
Payroll Number Semi-Monthly
I would like to create a column using dax that gives me a count of payroll, starting over each year and increasing semi-monthly on the 1st and 16th of each month. For example, the date table will sho...
- 7 years ago
Try this
NewCol = VAR Base_ = (2 * ( MONTH ( CalendarTable[Date] ) - 1 )) + 1 RETURN SWITCH (TRUE (); DAY ( CalendarTable[Date] ) < 16; Base_; Base_ + 1 )
AlB
7 years agoCommunity Champion
Hi bice_cold
Try this for a calculated column:
NewCol =
SWITCH (
TRUE (),
VAR Base_ = (2 * ( MONTH ( Table1[Date] ) - 1 )) + 1
RETURN
DAY ( Table1[Date] ) < 16, Base_,
Base_ + 1
)
bice_cold
7 years agoFrequent Visitor
Thanks for the response AlB . I tried this, but I got this error:
"Failed to resolve name 'Base_'. It is not a valid table, variable, or function name."
- AlB7 years agoCommunity Champion
Try this
NewCol = VAR Base_ = (2 * ( MONTH ( CalendarTable[Date] ) - 1 )) + 1 RETURN SWITCH (TRUE (); DAY ( CalendarTable[Date] ) < 16; Base_; Base_ + 1 )
- bice_cold7 years agoFrequent Visitor
This worked, thanks so much! I've never come across something like this before. It's a really interesting and creative solution.