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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to priodize a payment in Power BI

Hello experts. 

 

Can you please show me a way to periodize a payment that happens on a certain date, but I want the payment to be shown as four payments in the current quarter (in reference to the date) and the next three quarters in Power Query (Power BI). Please see the imiage below for an illustration. 

 

rouzbehrasai_0-1675771984243.png

Thank you for the help.

 

Best regards,

RR

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Here is my solution. 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("PcnBCQAgDEPRXXIWaaN2mdL91zCiGHL5vEw4Gsy7TuNUuGmoluCjOLQU/DRUw7rzUCjmpdo=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Project = _t, #"Income date" = _t, Income = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Project", Int64.Type}, {"Income date", type date}, {"Income", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Income Quarter", each List.Generate(
    () => [x = 1, y = [Income date]], 
    each [x] <= 4,
    each [x = [x] + 1, y = Date.AddQuarters([y], 1)],
    each [y] 
)),
    #"Expanded Income Quarter" = Table.ExpandListColumn(#"Added Custom", "Income Quarter"),
    Custom1 = Table.TransformColumns(#"Expanded Income Quarter", {{"Income Quarter", each "Q" & Text.From(Date.QuarterOfYear(_)) & " " & Text.From(Date.Year(_))}}),
    #"Added Custom1" = Table.AddColumn(Custom1, "Quarterly Income", each [Income]/4),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom1",{"Project", "Income Quarter", "Quarterly Income"})
in
    #"Removed Other Columns"

Steps are:

1. Create a custom column to have a list of 4 dates on every row. 

2. Expand the lists to new rows. 

3. Add a custom step to transform the dates to corresponding quarter year values. 

4. Add a custom column to divide income values by 4. 

5. Remove unnecessary columns.  

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

NewStep= #table({"Project","Quarter","Income"},List.TransformMany(Table.ToRows(PreviousStep),each {0..3},(x,y)=>let a=Date.AddQuarters(x{1},y) in {x{0},Number.ToText(Date.QuarterOfYear(a),"\Q0 ")&DateTime.ToText(a,"yyyy"),if y<3 then x{2}/4 else x{2}-x{2}/4*3}))

v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Here is my solution. 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("PcnBCQAgDEPRXXIWaaN2mdL91zCiGHL5vEw4Gsy7TuNUuGmoluCjOLQU/DRUw7rzUCjmpdo=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Project = _t, #"Income date" = _t, Income = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Project", Int64.Type}, {"Income date", type date}, {"Income", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Income Quarter", each List.Generate(
    () => [x = 1, y = [Income date]], 
    each [x] <= 4,
    each [x = [x] + 1, y = Date.AddQuarters([y], 1)],
    each [y] 
)),
    #"Expanded Income Quarter" = Table.ExpandListColumn(#"Added Custom", "Income Quarter"),
    Custom1 = Table.TransformColumns(#"Expanded Income Quarter", {{"Income Quarter", each "Q" & Text.From(Date.QuarterOfYear(_)) & " " & Text.From(Date.Year(_))}}),
    #"Added Custom1" = Table.AddColumn(Custom1, "Quarterly Income", each [Income]/4),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom1",{"Project", "Income Quarter", "Quarterly Income"})
in
    #"Removed Other Columns"

Steps are:

1. Create a custom column to have a list of 4 dates on every row. 

2. Expand the lists to new rows. 

3. Add a custom step to transform the dates to corresponding quarter year values. 

4. Add a custom column to divide income values by 4. 

5. Remove unnecessary columns.  

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.