Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago

Dynamic Months as Headers Help

Good morning all,

 

Hope you are all well. I'm still very new to Power Query (I'm on Excel) and I have a document which has the headers Jan - Dec to simulate a full years worth of data, however, now that i've loaded in the current times file (Jan - Aug), Power Query cannot find the months of Sep - Dec and will not proceed with the further steps. The two steps I am using that requires the dynamic months is a headers change and a value replacement from "" to "0"

 

Is there a way i can keep all the steps that have all months but negate any that are not found on the sheet? This is what i've currently got but any help would be greatly appreciated.

 

= Table.RenameColumns(Sheet1_Sheet,{{"Column1", "DealershipID"}, {"Column2", "Total"}, {"Column3", "Jan"}, {"Column4", "Feb"}, {"Column5", "Mar"}, {"Column6", "Apr"}, {"Column7", "May"}, {"Column8", "Jun"}, {"Column9", "Jul"}, {"Column10", "Aug"}, {"Column11", "Sep"}, {"Column12", "Oct"}, {"Column13", "Nov"}, {"Column14", "Dec"}})

 

Thanks in advance.

3 Replies