Forum Discussion
Need to create a shift (days off) calendar in matrix visualisation - overlaid with vacations
- 1 year ago
If you change the isOff measure to...
isOff = var _employee = SELECTEDVALUE(vacationTable[Name]) var _shiftEffectDate = MINX(shift_table, shift_table[EffectiveDate]) var _modValue = MINX(shift_table, shift_table[DaysOn]) + MINX(shift_table, shift_table[DaysOff]) var _comparisonValue = MINX(shift_table, shift_table[DaysOn]) var _testValue = Value(SELECTEDVALUE(dimDate[Date]) - _shiftEffectDate) var _mod = MOD(_testValue, _modValue) var _shiftName = "#FFB6C1"//MINX(shift_table, shift_table[Name]) var _testDate = SELECTEDVALUE(dimDate[Date]) var _offCount = COUNTROWS(FILTER(vacationTable, vacationTable[Name] = _employee && vacationTable[Date] = _testDate)) Return IF( _testValue >= 0, IF(_mod>=_comparisonValue,_shiftName,IF(_offCount>0,"#fed70d" ,"")), "" )You will end up with...
ok, ok, ok ! that's fantastic....and almost there - can I go for one more ask ???
on the matrix itself, there's only 2 colours in play - for vacation/other, and shift days off - I don't need the shift days off in the actual crew colour.....
I thought it's handled in the 'isOff' measure - so I replaced "black" with a hex colour, but don't easily interpret where to change the shift colour - is that possible ???
Colours I need are :
If you change the isOff measure to...
isOff =
var _employee =
SELECTEDVALUE(vacationTable[Name])
var _shiftEffectDate =
MINX(shift_table, shift_table[EffectiveDate])
var _modValue =
MINX(shift_table, shift_table[DaysOn]) + MINX(shift_table, shift_table[DaysOff])
var _comparisonValue =
MINX(shift_table, shift_table[DaysOn])
var _testValue =
Value(SELECTEDVALUE(dimDate[Date]) - _shiftEffectDate)
var _mod =
MOD(_testValue, _modValue)
var _shiftName =
"#FFB6C1"//MINX(shift_table, shift_table[Name])
var _testDate =
SELECTEDVALUE(dimDate[Date])
var _offCount =
COUNTROWS(FILTER(vacationTable, vacationTable[Name] = _employee && vacationTable[Date] = _testDate))
Return
IF(
_testValue >= 0,
IF(_mod>=_comparisonValue,_shiftName,IF(_offCount>0,"#fed70d" ,"")),
""
)
You will end up with...
- coochy51 year ago
Helper II
fantastic !
thank you very much !
Looks like what I need exactly !
I'll run through the changes to prod let you know how it goes !
Many thanks again for your assistance !
- coochy51 year ago
Helper II
Gosh, I've broken it again !
I've tried to incorporate with prod data - so have tinkered with the isOff and isOn measures (just substituting the table names), and added to the dimDate table (just more columns) - and I think I've replicated all....but end result is that whilst vacations plot correctly, all shift schedules seem to start and end of the same dates.
Any idea what's going on here ?
In the sample data set - shift off days should be:
Red off shift 12/19-12/24
Blue off shift 01/02 - 01/07
Yellow off shift - 12/26-12/31