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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

how to create more columns in one step or how to transfer formulas between files

Hi, 

 

Is there a way to create calculated columns on the step of creating new table? 

 

Example: I need to get Fiscal year column, so I try this:

Dates = ADDCOLUMNS(CALENDAR(date(2015,1,1),date(2017,12,31)),
                      "DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ),
                      "Year", YEAR ( [Date] ),
                      "Month number", month( [Date]),
                      "YearQuarter", FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" ),
                      "Financial year", IF(Dates[Month number]>6,Dates[Year]+1,Dates[Year])
                                     )

This example doesnt work. I guess it's because the Dates table doesn't exists at this point.

I know I could just create the table first and then add new column with expression that I need, but I have many calculated columns and measures, that I use for different files. Some of them I've been able to put together in one step, but those are only cases, when I work with column from the source table..

 

 

So is there any other option, how to create some columns in one step or how to transfer formulas between different files?

 

Thanks,

Zuzana

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

I dont think you can do it one step but yes you can copy the formula. Click on Advance Editor in query windows and you can copy paste from one place to another. I do this all the time, let me know if you need screen shots on how to do this?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

I dont think you can do it one step but yes you can copy the formula. Click on Advance Editor in query windows and you can copy paste from one place to another. I do this all the time, let me know if you need screen shots on how to do this?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

thanks.. this actually helped a lot

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.