Forum Discussion
Split annual value across 12 months with dates
- 2 years ago
Hi again SysJessica1 ,
Whenever the name of a step in power query contains a space, the name needs to be in quotes and preceeded by a "#" character. For example #"Changed Type". If this step were named ChangedType, without a space, it woudn't need the "#" or quote marks.
When you create the blank query, open it in the Advanced Editor (Power Query Home Ribbon -> Advanced Editor button). You will see
let
Source = ""
in
SourceReplace all of this with the code in my previous reply and click "Done". This will yield the result in the image I included in my previous reply. The first two steps in the code - "Source" and "Changed Type" are only there to recreate a sample of data - it's the steps after that which matter.
However, that is only for demo purposes. To use my code in your own query do the following.
- Open your query in Advanced Editor.
- Delete the last two lines of your query (the "in" line and whatever follows it e.g....)
in
#"Changed Type1" - Add a comma at the end of the last line you have left.
- After the comma place my code (excluding its first two lines).
- Where I have #"Create lists of monthly amount and date" replace that with the name of the last step you had after you deleted your last two lines.
- Click "Done".
This will create a monthly cost for each month of 2024 for all your IDNumbers.
Hope this works for you.
Hi again SysJessica1 ,
Whenever the name of a step in power query contains a space, the name needs to be in quotes and preceeded by a "#" character. For example #"Changed Type". If this step were named ChangedType, without a space, it woudn't need the "#" or quote marks.
When you create the blank query, open it in the Advanced Editor (Power Query Home Ribbon -> Advanced Editor button). You will see
let
Source = ""
in
Source
Replace all of this with the code in my previous reply and click "Done". This will yield the result in the image I included in my previous reply. The first two steps in the code - "Source" and "Changed Type" are only there to recreate a sample of data - it's the steps after that which matter.
However, that is only for demo purposes. To use my code in your own query do the following.
- Open your query in Advanced Editor.
- Delete the last two lines of your query (the "in" line and whatever follows it e.g....)
in
#"Changed Type1" - Add a comma at the end of the last line you have left.
- After the comma place my code (excluding its first two lines).
- Where I have #"Create lists of monthly amount and date" replace that with the name of the last step you had after you deleted your last two lines.
- Click "Done".
This will create a monthly cost for each month of 2024 for all your IDNumbers.
Hope this works for you.
This worked! Thank you for your help!