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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Add more years to a table

Hi everyone!

I have a table from SQL with some data by years/months that stops at December 2023.

I want to add more years with the same data as previous year, where Value is multiplied by 5%. 

Example for 2024, I need to have the same number of rows with the same data, except culmun Value which will be = Value * 5%.

Is it possible? Maybe in power query?

Thank you!

adriandumitru_0-1675250877231.png

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

In Power Query you could duplicate the query for 2023, switch to the transform ribbon and use the Standard section from the Number column section to add 1 to the year and multiply the value by 1.05. Then append the 2 queries.

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

In Power Query you could duplicate the query for 2023, switch to the transform ribbon and use the Standard section from the Number column section to add 1 to the year and multiply the value by 1.05. Then append the 2 queries.

Anonymous
Not applicable

Thank You, but maybe there is a more automated solution?

I will need at least 3 more years to replicate and append, this will have an impact on performance.

You could do it in the SQL. Depending on the flavour of SQL you could take the query which currently pulls data for 2022 and use that to define a CTE. Then the query which returns data could be a union of the base data and as many copies as you need, adding values to the year column and changing the data values.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors