Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
HI,
I need to create a quarter column that changes over month. It needs to group the months by three as mobile quarters. When a new month appears in the data, this one will be the last month of the last quarter. Here are some examples:
In the above image, the last month is January 2021, so the quarter its named the same and groups the last three months of the data. What happens when february comes to the data model?:
How can I create a calculated column to achieve this?
Thanks!
Solved! Go to Solution.
Hi @Anonymous ,
Here are the steps you can follow:
1. Enter power query through transform data and select add column --- index column --- from 1 to generate the index
2. Create calculated column.
Quarter =
var _mod=MOD([Index],3)
return
SWITCH(
TRUE(),
_mod=1,CALCULATE(MAX([Month]),FILTER('Table',[Index]=EARLIER([Index])+2)),
_mod=2,CALCULATE(MAX([Month]),FILTER('Table',[Index]=EARLIER([Index])+1)),
_mod=0,[Month])2. Result.
You can downloaded PBIX file from here.
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.
Hi @Anonymous ,
Here are the steps you can follow:
1. Enter power query through transform data and select add column --- index column --- from 1 to generate the index
2. Create calculated column.
Quarter =
var _mod=MOD([Index],3)
return
SWITCH(
TRUE(),
_mod=1,CALCULATE(MAX([Month]),FILTER('Table',[Index]=EARLIER([Index])+2)),
_mod=2,CALCULATE(MAX([Month]),FILTER('Table',[Index]=EARLIER([Index])+1)),
_mod=0,[Month])2. Result.
You can downloaded PBIX file from here.
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.
@Anonymous , seems like you have FY that ends in Jan/Apr/Jul/Oct.
Refer to my blog where you can have qtr start date for any on the 12 month start.
1.Creating Financial Calendar - From Any Month
https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calendar-1-5-Power/ba-p/1187441
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!