Forum Discussion
DAX CALENDARAUTO()
HI
This may just seem like a simple solution, I maybe am over complicating matters here, but what I think makes sense DAX just disagrees or does the opposite to what I want. I am a litte lost.
This is my forumla in DAX, I am trying to create a Date table, which will evetually will be populated with our Fiscal Periods and Quarters. I thought if I could first get the key Date column right then the rest would just fall into place; thats the theory.
My Formula:
Looks good. You can simplify the switch statements to either
SWITCH (TRUE(),[MonthNumber] in {11,12,1},"Q2" ,[MonthNumber] in {2,3,4},"Q3" ,[MonthNumber] in {5,6,7},"Q4" ,[MonthNumber] in {8,9,10},"Q1" ,blank() )or
SWITCH ([MonthNumber],1,"Q2",2,"Q3",3,"Q3",4,"Q3",5,"Q4",6,"Q4", 7,"Q4",8,"Q1",9,"Q1",10,"Q1",11,"Q2",12,"Q2",blank() )
8 Replies
- lbendlinSuper User
That's a rather inventive use of CALENDARAUTO. Have you considered using CALENDAR() and then just adding your own Fiscal Year logic? Or even better, use an external Dates table.
- AnonymousNot applicable
Hi
I have a datasource; what I mean by a datasource is I have a table with many columns which cover various periods/ranges but I am only interested in two columns, which is my key or main focus was to try and use the FiscalYearEndMonth part along with some filtering.
When use the CALENDARAUTO in its own I get years in the range from 1979 to 2056, when I am only needing to look at say 2010 to 2020. Its picking up another set of dates that are not needed for this purpose or not needed for working out the Fiancial Years if that makes sense.
I thought adding some additional filtering to the forumla would offer some flexability to the range I wanted to use.
Chris
- lbendlinSuper User
You're better off supplying your own dates table where you can control the range and the fiscal logic.