Forum Discussion
Change the quarter months
- Anonymous2 years ago
Hi Pklu,
You can add a new column to raw table to get the new quarter value. Then you can use date field year level, new quarter, date field month level to create a hierarchy slicer to achieve your requirement.
Fiscal Quarter = VAR offset = 3 VAR newQuarter = QUARTER ( DATE ( YEAR ( Table1[StartDate] ), MONTH ( Table1[StartDate] ) + offset, DAY ( Table1[StartDate] ) ) ) RETURN "Q" & newQuarter
Regards,Xiaoxin Sheng
HI Pklu,
Table columns cannot directly be invoked in measure expression, I'd like to suggest you use aggregation functions to get the current value at first and stored in the variable. Then you can use this variable value to compare with conditions.
Quarter to Month =
VAR currQuarter =
SELECTEDVALUE ( 'Event Dates'[Quarter] )
RETURN
SWITCH (
currQuarter,
"Q1", "October, November, December",
"Q2", "January, February, March",
"Q3", "April, May, June",
"Q4", "July, August, September",
BLANK ()
)
Regards.
Xiaoxin Sheng
Hello Sheng, Anonymous
Tthank you so much for your code. The code worked but I had to change it to the following to get it to work properly.
- Anonymous2 years agoNot applicable
Hi Pklu,
You can add a new column to raw table to get the new quarter value. Then you can use date field year level, new quarter, date field month level to create a hierarchy slicer to achieve your requirement.
Fiscal Quarter = VAR offset = 3 VAR newQuarter = QUARTER ( DATE ( YEAR ( Table1[StartDate] ), MONTH ( Table1[StartDate] ) + offset, DAY ( Table1[StartDate] ) ) ) RETURN "Q" & newQuarter
Regards,Xiaoxin Sheng