Forum Discussion
Dynamic Date Axis
- 6 years ago
You may add an appropriate measure to Visual level filters.
https://community.powerbi.com/t5/Desktop/Create-Axis-values-as-slicer/m-p/587458#M278489
You may add an appropriate measure to Visual level filters.
https://community.powerbi.com/t5/Desktop/Create-Axis-values-as-slicer/m-p/587458#M278489
- staceyrain6 years agoFrequent Visitor
That might be the solution, but I sure couldn't make it work. I tried a few different methods and can't get the dates to filter based on the project selected. I have a table that shows the project name and the minimum and maximum dates that should be on the chart (CRMinMaxFinDates) and created this measure, but that's a list and won't work as a filter, so I did the same thing, making it a dynamic table and tried to use the column from that table as the X-Axis, but it doesn't filter when I select the project.
FilteredDates =VAR Date1 = LOOKUPVALUE(CRMinMaxFinDates[MinDate],CRMinMaxFinDates[PROJECTID],SELECTEDVALUE(Tasks[Projects.PROJECTID]))-7VAR Date2 = LOOKUPVALUE(CRMinMaxFinDates[MaxDate],CRMinMaxFinDates[PROJECTID],SELECTEDVALUE(Tasks[Projects.PROJECTID]))RETURN DATESBETWEEN(WEDates[WEDate],Date1,Date2)I did also try your method of creating an IF measure to return a 1 or 0 but when I add it as a filter and select only the 1's the chart has no dates and I suspect my MIN MAX functions are not correct, but I can't figure out how to refrence the dates on the X-Axis.DateCheck =VAR Date1 = LOOKUPVALUE(CRMinMaxFinDates[MinDate],CRMinMaxFinDates[PROJECTID],SELECTEDVALUE(Tasks[Projects.PROJECTID]))-7VAR Date2 = LOOKUPVALUE(CRMinMaxFinDates[MaxDate],CRMinMaxFinDates[PROJECTID],SELECTEDVALUE(Tasks[Projects.PROJECTID]))VAR FlagDateCheck =IF(MIN(DateTableQuery[WeekEndDate])<Date1|| MAX(DateTableQuery[WeekEndDate])>Date2,0,1)RETURN FlagDateCheck- staceyrain6 years agoFrequent Visitor
I got it to work by replacing the MIN and MAX in the IF statement with SELECTEDVALUE. I thought when I'd done that initially it didn't work, but it does seem to. Thanks for your help.