Forum Discussion
Need Support in Complex Dax and Visualization filters
Try creating few calculated columns and measures first.
Next Occurrence =
SWITCH(
TRUE(),
'Table'[repeat_by] = "days", DATEADD('Table'[Start_date], 'Table'[repeat_every], DAY),
'Table'[repeat_by] = "weeks", DATEADD('Table'[Start_date], 'Table'[repeat_every] * 7, DAY),
// Add logic for months and years
'Table'[Start_date] // Default case to return start date if no repeat
)
Time Bin =
SWITCH(
TRUE(),
'Table'[Start_time] >= TIME(13, 0, 0) && 'Table'[Start_time] < TIME(14, 0, 0), "13:00-14:00",
// ... other bins ...
"Outside of bins" // Default case
)
Measure for Filtering Tasks:
Task Count for Selected Date =
CALCULATE(
COUNTROWS('Table'),
FILTER(
'Table',
'Table'[Next Occurrence] = SELECTEDVALUE(DateTable[Date])
)
)
Use Visuals to Display Data
- Use a slicer for the date selection.
- Use a matrix or bar chart to show the number of tasks per time bin.
- You can use the created measure to filter the visual to only show data for the selected date.
Hope this helps. Make sure to adjust table and column names accordingly