Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi everyone, i have difficulties about converting BIS data Q1, Q2, Q3, Q4 to mm/dd/yy format. the following code is used for get data from BIS website. the the second screen shot is data i got. is there anyways to convert time period data to format like 3rd photos?
Solved! Go to Solution.
You can issue following statement where Source should be replaced with your previous step
Table.ReplaceValue(Source,each [#"Attribute:TIME_PERIOD"],each Date.EndOfMonth(#date(Number.From(Text.BeforeDelimiter([#"Attribute:TIME_PERIOD"],"-")),Number.From(Text.End([#"Attribute:TIME_PERIOD"],1))*3,1)),Replacer.ReplaceValue,{"Attribute:TIME_PERIOD"})
See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrQ0N9cNNFGK1QGzLXQDDaFsCwPdQCMo29JSN9AYzDYyMDAGq4kFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Attribute:TIME_PERIOD" = _t]),
Custom = Table.ReplaceValue(Source,each [#"Attribute:TIME_PERIOD"],each Date.EndOfMonth(#date(Number.From(Text.BeforeDelimiter([#"Attribute:TIME_PERIOD"],"-")),Number.From(Text.End([#"Attribute:TIME_PERIOD"],1))*3,1)),Replacer.ReplaceValue,{"Attribute:TIME_PERIOD"}),
#"Changed Type" = Table.TransformColumnTypes(Custom,{{"Attribute:TIME_PERIOD", type date}})
in
#"Changed Type"
thank you , problem is solved
NewStep=Table.TransformColumns(Source{1}[Table]{0}[#"Namespace:"]{0}[Series]{0}[Obs],{"Attribute:TIME_PERIOD",each Date.AddDays(Date.AddQuarters(Date.From(Text.BeforeDelimiter(_,"-")&"-1-1"),Number.From(Text.AfterDelimiter(_,"Q"))),-1)})
You can issue following statement where Source should be replaced with your previous step
Table.ReplaceValue(Source,each [#"Attribute:TIME_PERIOD"],each Date.EndOfMonth(#date(Number.From(Text.BeforeDelimiter([#"Attribute:TIME_PERIOD"],"-")),Number.From(Text.End([#"Attribute:TIME_PERIOD"],1))*3,1)),Replacer.ReplaceValue,{"Attribute:TIME_PERIOD"})
See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrQ0N9cNNFGK1QGzLXQDDaFsCwPdQCMo29JSN9AYzDYyMDAGq4kFAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Attribute:TIME_PERIOD" = _t]),
Custom = Table.ReplaceValue(Source,each [#"Attribute:TIME_PERIOD"],each Date.EndOfMonth(#date(Number.From(Text.BeforeDelimiter([#"Attribute:TIME_PERIOD"],"-")),Number.From(Text.End([#"Attribute:TIME_PERIOD"],1))*3,1)),Replacer.ReplaceValue,{"Attribute:TIME_PERIOD"}),
#"Changed Type" = Table.TransformColumnTypes(Custom,{{"Attribute:TIME_PERIOD", type date}})
in
#"Changed Type"
Hi @liuj3,
The simpliest is the straightforward replacement.Something like this:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrQ0N9cNNFGK1QGzLXQDDZHYRkhsYyQ2UH0sAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Attribute: TIME_PERIOD" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Attribute: TIME_PERIOD", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","Q4","12-31",Replacer.ReplaceText,{"Attribute: TIME_PERIOD"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","Q1","03-31",Replacer.ReplaceText,{"Attribute: TIME_PERIOD"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1","Q2","06-30",Replacer.ReplaceText,{"Attribute: TIME_PERIOD"}),
#"Replaced Value3" = Table.ReplaceValue(#"Replaced Value2","Q3","09-30",Replacer.ReplaceText,{"Attribute: TIME_PERIOD"}),
#"Parsed Date" = Table.TransformColumns(#"Replaced Value3",{{"Attribute: TIME_PERIOD", each Date.From(DateTimeZone.From(_)), type date}})
in
#"Parsed Date"
Alternatively, you can create a table of dates to quarters. Spit the time period column to separate out Qx andthen merge using the dates to quarters table.
Kind regards,
John
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.