Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
In calendar_dimension table, I tried to create Group Quarter-Year calculated column and Group Quarter-Year sort calculated column.
Group Quarter-Year =
VAR _today =
TODAY ()
VAR _indexquarteryear =
ROWNUMBER (
VALUES ( calendar_dim[End of Quarter] ),
ORDERBY ( calendar_dim[End of Quarter], ASC )
)
VAR _todayindex =
MAXX (
FILTER (
ADDCOLUMNS (
calendar_dim,
"@indexquarteryear",
ROWNUMBER (
VALUES ( calendar_dim[End of Quarter] ),
ORDERBY ( calendar_dim[End of Quarter], ASC )
)
),
calendar_dim[date] = _today
),
[@indexquarteryear]
)
RETURN
SWITCH (
TRUE (),
_indexquarteryear <= _todayindex
&& _indexquarteryear >= _todayindex - 2, "Current Engagement",
_indexquarteryear <= _todayindex - 3
&& _indexquarteryear >= _todayindex - 5, "Initial Interactions",
_indexquarteryear <= _todayindex - 6, "Purchased",
_indexquarteryear > _todayindex, "Future ML prediction",
"Check again"
)
Group Quarter-Year sort =
VAR _today =
TODAY ()
VAR _indexquarteryear =
ROWNUMBER (
VALUES ( calendar_dim[End of Quarter] ),
ORDERBY ( calendar_dim[End of Quarter], ASC )
)
VAR _todayindex =
MAXX (
FILTER (
ADDCOLUMNS (
calendar_dim,
"@indexquarteryear",
ROWNUMBER (
VALUES ( calendar_dim[End of Quarter] ),
ORDERBY ( calendar_dim[End of Quarter], ASC )
)
),
calendar_dim[date] = _today
),
[@indexquarteryear]
)
RETURN
SWITCH (
TRUE (),
_indexquarteryear <= _todayindex
&& _indexquarteryear >= _todayindex - 2, 0,
_indexquarteryear <= _todayindex - 3
&& _indexquarteryear >= _todayindex - 5, -1,
_indexquarteryear <= _todayindex - 6, -2,
_indexquarteryear > _todayindex, 1,
100
)
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
In calendar_dimension table, I tried to create Group Quarter-Year calculated column and Group Quarter-Year sort calculated column.
Group Quarter-Year =
VAR _today =
TODAY ()
VAR _indexquarteryear =
ROWNUMBER (
VALUES ( calendar_dim[End of Quarter] ),
ORDERBY ( calendar_dim[End of Quarter], ASC )
)
VAR _todayindex =
MAXX (
FILTER (
ADDCOLUMNS (
calendar_dim,
"@indexquarteryear",
ROWNUMBER (
VALUES ( calendar_dim[End of Quarter] ),
ORDERBY ( calendar_dim[End of Quarter], ASC )
)
),
calendar_dim[date] = _today
),
[@indexquarteryear]
)
RETURN
SWITCH (
TRUE (),
_indexquarteryear <= _todayindex
&& _indexquarteryear >= _todayindex - 2, "Current Engagement",
_indexquarteryear <= _todayindex - 3
&& _indexquarteryear >= _todayindex - 5, "Initial Interactions",
_indexquarteryear <= _todayindex - 6, "Purchased",
_indexquarteryear > _todayindex, "Future ML prediction",
"Check again"
)
Group Quarter-Year sort =
VAR _today =
TODAY ()
VAR _indexquarteryear =
ROWNUMBER (
VALUES ( calendar_dim[End of Quarter] ),
ORDERBY ( calendar_dim[End of Quarter], ASC )
)
VAR _todayindex =
MAXX (
FILTER (
ADDCOLUMNS (
calendar_dim,
"@indexquarteryear",
ROWNUMBER (
VALUES ( calendar_dim[End of Quarter] ),
ORDERBY ( calendar_dim[End of Quarter], ASC )
)
),
calendar_dim[date] = _today
),
[@indexquarteryear]
)
RETURN
SWITCH (
TRUE (),
_indexquarteryear <= _todayindex
&& _indexquarteryear >= _todayindex - 2, 0,
_indexquarteryear <= _todayindex - 3
&& _indexquarteryear >= _todayindex - 5, -1,
_indexquarteryear <= _todayindex - 6, -2,
_indexquarteryear > _todayindex, 1,
100
)
Hi @powerbiexpert22 ,
In what way do you want the label to grouped? For example, for initial purchase which has two quarters, there is just a single label?
Hi @danextian , sorry i should not use the word group however this is what i wanted to acheive
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.