Forum Discussion
How to group quarters?
I'm trying to display my data grouped by Q1+Q4 and Q2+Q3, but the option to create data groups on the modeling group disappears when I'm at the Quarter level in Date Hierarchy. I think I must be missing something obvious, but my searches are all turning up how to group my data into quarters, rather than how to group my quarters together. Any help appreciated!
- Anonymous3 years ago
Hi ReadTheIron ,
Here are the steps you can follow:
1. Enter data – create a table.
2. Create measure.
Measure = SWITCH( TRUE(), MAX('Table2'[Group])= "Q1+Q4", SUMX( FILTER(ALL('Table'), QUARTER('Table'[Date])=1 || QUARTER('Table'[Date])=4),[Value]), MAX('Table2'[Group])= "Q2+Q3", SUMX( FILTER(ALL('Table'), QUARTER('Table'[Date])=2 || QUARTER('Table'[Date])=3),[Value]))3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
2 Replies
- amitchandak
Super User
ReadTheIron , they should group under year.
How are you using those
I usually prefer to create columns in date/calendar table and join back with table and use that
Calendar = Addcolumns(calendar(date(2012,01,01), date(2024,12,31) ), "Month no" , month([date])
, "Year", year([date])
, "Month Year", format([date],"mmm-yyyy")
, "Month year sort", year([date])*100 + month([date])
, "Qtr Year", format([date],"yyyy-\QQ")
, "Qtr", quarter([date])
, "Month",FORMAT([Date],"mmmm")
, "Month sort", month([DAte])
, "FY Year", if( Month(([DAte])) <7 , year(([DAte]))-1 ,year(([DAte])))
, "Is Today" ,if([Date]=TODAY(),"Today",[Date]&"")
,"Day of Year" , datediff(date(year([DAte]),1,1), [Date], day)+1
, "Month Type", Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY") )
,"Year Type" , Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)
) - AnonymousNot applicable
Hi ReadTheIron ,
Here are the steps you can follow:
1. Enter data – create a table.
2. Create measure.
Measure = SWITCH( TRUE(), MAX('Table2'[Group])= "Q1+Q4", SUMX( FILTER(ALL('Table'), QUARTER('Table'[Date])=1 || QUARTER('Table'[Date])=4),[Value]), MAX('Table2'[Group])= "Q2+Q3", SUMX( FILTER(ALL('Table'), QUARTER('Table'[Date])=2 || QUARTER('Table'[Date])=3),[Value]))3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly