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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ldwf
Helper V
Helper V

Add a calculated column to a dataflow

I have created several PBI dataflows with the intention of having them feed a PBI datamart.  I want to create some calculated fields in the flow using DAX, just like I do on PBI desktop.  However, I don't seem to see an option that would allow me to create calculated fields using DAX.  I do see the option to create a measure in the datamart, but I don't see anything about calculated fields.  How would I be able to build calculated fields using DAX?

1 ACCEPTED SOLUTION

Absolutely. Having these complex calculated columns in the first place is a design red flag. Don't forget -they eat up space AND compute when they are calculated.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @ldwf 

 

In Power BI dataflows, you can't create calculated fields using DAX directly as you do in Power BI Desktop. Dataflows use Power Query, which relies on M code for transformations and calculations

But unfortunately, there isn't a direct tool to convert DAX to M code.

 

Just as lbendlin posted that you'd better off re-implementing the business logic.

 

Otherwise you can only use M-code to rewrite your calculated column as a custom column manually, I believe this is a huge amount of work. 

Solved: Creating a calculated table in PowerBI Service dat... - Microsoft Fabric Community

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

There is no need for DAX.  use Table.AddColumn in your Power Query M code.

Some of the DAX code we build is quite extensive, i.e, like 50 or more lines for just one calculated column.  If I want to clone these calculated columns, do I need to rebuild all the DAX formulas in Power Query M code?

Absolutely. Having these complex calculated columns in the first place is a design red flag. Don't forget -they eat up space AND compute when they are calculated.

is there a tool for converting DAX to Power Query M?

Not that I am aware of. You are likely better off re-implementing the business logic.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.