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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Add missing rows for missing numbers

Hello, 

Can you please help me how to add rows that are missing in the current table?

 

In below picture, I am missing;

Accident Year 1997, Period 9,

Accident Year 1997, Period 10,

Accident Year 1999, Period 19,

Accident Year 2000, Period 19,

Accident Year 2000, Period 17,

Accident Year 2002, Period 16.

 

How do I add these values into the table using append or other method? I CANNOT manually enter them because the source is from SQL database. 

 

How can I create a table that has multiple years with multiple period? (i.e. Accident Year 2000, Period 1, Accident Year 2000, Period 2 etc.)

 

I appreciate your time and help in advance!

 

Period is not a month. Period is duration.

2022-07-27_11-44-56.png

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Please see below code on how to year and period table:

let
    Source = Table.FromList({1997..Date.Year(DateTime.LocalNow())},Splitter.SplitByNothing(), {"Year"}),
    #"Added Custom" = Table.AddColumn(Source, "Period", each {1..12}),
    #"Expanded Period" = Table.ExpandListColumn(#"Added Custom", "Period")
in
    #"Expanded Period"

 

KT_Bsmart2gethe_0-1659047368284.png

 

Regards

KT

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @jennratten

Thank you so much for your reply message. Can you please help me automate this? 

 

How would you create a table that has series of years and period? My table would look like this...

 

Year (1997~Current)           Period (1~250)

1997                                         1

1997                                         2

1997                                         3

....                                             ....

1997                                        250

1998                                         1

1998                                         2

 

I appreciate your time and help!!

Hi @Anonymous ,

 

Please see below code on how to year and period table:

let
    Source = Table.FromList({1997..Date.Year(DateTime.LocalNow())},Splitter.SplitByNothing(), {"Year"}),
    #"Added Custom" = Table.AddColumn(Source, "Period", each {1..12}),
    #"Expanded Period" = Table.ExpandListColumn(#"Added Custom", "Period")
in
    #"Expanded Period"

 

KT_Bsmart2gethe_0-1659047368284.png

 

Regards

KT

jennratten
Super User
Super User

Hello - you can add a new table with these values and then append the tables together.

 

Add a new table:

jennratten_0-1658975589923.png

 

Then append the tables, like so:

= Table.Combine ( { Table1, AdditionalValues } )

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.