Forum Discussion
DAX Filter Table By Weekday Slicers - Two Date Columns
Hey all,
Sample data: SampleData1.xlsx
I have a main table with columns for DateTime by the minute, an open price, a close price, a high price and a low price. I have added a week day and number column as well. I also have a DateTable with week day info (day, day number, week number, etc).
My requirements are to create an output / visual table that shows a table:
- With a week start column and week end date column by weekday. The weekdays are filtered by two slicers, one for week start and one for week end. So we could have a week start Monday and end Friday, but could also look at week start Tuesday and end Thursday. We also need to account for wrap around weeks, so a week start on Friday and end the following Monday.
- And with a slicer for Open to Open, Open to Close, and Close to Open based on the earliest open price and latest close price for the given dates. So for example, the Open to Close selection would show the week start date open price and the week end date close price.
Example below:
My first thoughts were to create separate date tables to filter each the start and end of the week and create measures from those. However I run into an issue when applying the filters to the table visual, I get a blank result. It seems I am having trouble filtering individually the week start and week end and having them populate appropriately in the table visual.
Thanks everyone
You want to think long and hard before you go for this - it is very klutzy and I don't think the user experience will be meaningful
And yes - the week number column is critical. It will not work without it.
4 Replies
- lbendlinSuper User
What if the user chooses from Tuesday to Tuesday ?
See attached for a data reduction approach.
- Jlindsey001Frequent Visitor
Thanks lbendlin ... the output would still follow the parameters: I.e. open price 7/9 to close price 7/16, next row open price 7/16 to close 7/23, etc.
Assuming that is possible, otherwise we will not be able to do week day to same week day.
- lbendlinSuper User
You want to think long and hard before you go for this - it is very klutzy and I don't think the user experience will be meaningful
And yes - the week number column is critical. It will not work without it.