Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Convert Year Quarter format into date format

I am newbiee to PowerBI and trying to convert year quarter 1Q06 format to either date format (03/30/2006) or 2006 Q1 format by using power query. 

 

1 ACCEPTED SOLUTION
Nolock
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

to format from 1Q06 to 2016 Q1 use:

let
    Source = "1Q06",
    QuarterNr = Text.BeforeDelimiter(Source, "Q"),
    Year = "20" & Text.AfterDelimiter(Source, "Q"),
    NewFormat = Year & " Q" & QuarterNr
in
    NewFormat

And to convert from 1Q06 to the last day of a quarter use:

let
    Source = "1Q06",
    QuarterNr = Number.FromText(Text.BeforeDelimiter(Source, "Q")),
    Year = Number.FromText("20" & Text.AfterDelimiter(Source, "Q")),
    StartOfYear = #date(Year, 1, 1),
    EndOfQuarter = Date.AddDays(Date.AddQuarters(StartOfYear, QuarterNr), -1)
in
    EndOfQuarter

View solution in original post

1 REPLY 1
Nolock
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

to format from 1Q06 to 2016 Q1 use:

let
    Source = "1Q06",
    QuarterNr = Text.BeforeDelimiter(Source, "Q"),
    Year = "20" & Text.AfterDelimiter(Source, "Q"),
    NewFormat = Year & " Q" & QuarterNr
in
    NewFormat

And to convert from 1Q06 to the last day of a quarter use:

let
    Source = "1Q06",
    QuarterNr = Number.FromText(Text.BeforeDelimiter(Source, "Q")),
    Year = Number.FromText("20" & Text.AfterDelimiter(Source, "Q")),
    StartOfYear = #date(Year, 1, 1),
    EndOfQuarter = Date.AddDays(Date.AddQuarters(StartOfYear, QuarterNr), -1)
in
    EndOfQuarter

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors