Forum Discussion
Syndicate_Admin
Administrator
2 years agoHelp to perform date filtering from 20 to 21
Hello hello, I wanted to ask for a little guidance to be able to make a filter that can give me the corresponding year but mainly that the month starts from the 20th of the previous month to the 21st...
- 2 years ago
This one worked for me;
Reporting Month = if(Dates[Day of Month] < 21, Dates[Month & Year], FORMAT(DATEADD(Dates[Date], 1, MONTH), "MMM YYYY"))
ray_aramburo
Super User
2 years agoTo not overcomplicate yourself, I would recommend just use the date field in a slicer, set it up as a Between type and input your dates:
- Syndicate_Admin2 years ago
Administrator
I mean, I currently have it like this, the question is if there was something more friendly, like just selecting the month and having it perform the automatic conditioning
- ray_aramburo2 years ago
Super User
You wouldn't be able to use them as filters but you could create a pretty customized measure with time-intelligence and parameters. Something like:
DynamicMeasure = CALCULATE([WhateverExpressionYouWantToShow], DATESINPERIOD('DateTable'[Date], TODAY(),[ParameterField], MONTH))- Syndicate_Admin2 years ago
Administrator
If it really works for me, I ended up doing the following:
I made a start date
FiscalMonthStart =IF((('DateTable'[Day]) >= 21), EOMONTH([Date],-1),EOMONTH([Date],-2)) +21and another termFiscalMonthEnd =IF(DAY('DateTable'[Date]) >= 21,EOMONTH('DateTable'[Date], 0) + 20,EOMONTH('DateTable'[Date], -1) + 20)Uniting it inFiscalMonthName =FORMAT('DateTable'[FiscalMonthEnd], "MMMM YYYY")And then separating the information and then using what he mentioned to meAnd it was finally like thisThank you very much for your help