Forum Discussion
Leave days in Cube
Hi group,
I have 2 fields in a cube, FromDate and ToDate and also a measure (Sum of Leave Days) to calulate the days in between the dates...(see sample table)
I would like a DAX measure to catergorise the Sum of Leave Days into 1 Day, 2 Day and 3 Days and Greater...
- Anonymous4 years ago
HI Durbslaw,
I'd like to suggest you take a look at the following links about handle 'start date', 'end date' analysis and dynamic segment:
Before You Post, Read This#start date/end date
Dynamic segmentation – DAX Patterns
Regards,
Xiaoxin Sheng
3 Replies
- amitchandak
Super User
Durbslaw , new column, if possible
diff= datediff([Date from], [Date to], day)
you can create a new column
Switch(true() ,
[diff] <= 1 , " <= 1 Day",
[diff] <= 2 , " 1-2 Day",
// add other conditions
)
- Durbslaw
Helper I
Hi Amitchandak,
New columns and tables are out as the model won't permit those changes, I am thinking along the lines of a virtual or in memory table.
Thanks and regards,
- AnonymousNot applicable
HI Durbslaw,
I'd like to suggest you take a look at the following links about handle 'start date', 'end date' analysis and dynamic segment:
Before You Post, Read This#start date/end date
Dynamic segmentation – DAX Patterns
Regards,
Xiaoxin Sheng