Forum Discussion
Anonymous
6 years agoNot applicable
Filter Date Range using IF condition
Hi all, Is there any way we can restrict the dates from the Date Column in my data based on the conditions i.e., by using IF condition? If yes, please provide me the DAX syntax. A small illust...
Anonymous
6 years agoNot applicable
Thanks for the response amitchandak
Also, I have a table visual on which I need to filter a specific range of dates based on the selection in another date slicer, how can we do it?
I have my main table(T1) with columns including Date column, I created a duplicate of the T1 as T2 and removed every column except Date column. So when I select a value from the date column in T2, I need to get the data from the SelectedDate till SelectedDate-30 in a table visual which contains the columns from T1.
How can we achieve this ?
Thanks
Kashyap.
v-lili6-msft
Community Support
6 years agohi Anonymous
When you create a measure add this conditional in the formula as below:
eg.
Measure = CALCULATE(SUM('Table 1'[value]),FILTER('Table 1','Table 1'[Date]>=MAX('Table 2'[Date])-30&&'Table 1'[Date]<=MAX('Table 2'[Date])))
In this simple sample, I will show the data from the SelectedDate till SelectedDate-7
and here is sample pbix file, please try it.
Regards,
lin