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
Baji_Komara
Frequent Visitor

Appearance of Calculated DAX columns in Query editor/ transform data

Dear Team,

 I have  calculated columns in data view calculated using dax code, i want those columns to appear in query editor to unpivot them. how do i write an M code to appear the calcualted columns in query editor ? or is there any alternative way to do. 

Thanks in advance !

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Baji_Komara ,

The reason for this is because all the columns displayed in the power bi query come from the original data source. If the measure or column created by dax on the powerbi desktop can only be displayed in the data visual, it will not appear in the power bi query. And Power Query uses another language called M with a very different syntax than DAX.

 

So if you'd like your new column to appear in Power Query, you have to create it in Power Query:

vyangliumsft_0-1671000968753.png

There are also many other features on Power Query that you can check to see if they meet your needs, not necessarily only writing M language..

Query overview in Power BI Desktop - Power BI | Microsoft Learn

 

This is the related document, you can view this content:

Solved: Is there a way to make calculated columns show in ... - Microsoft Power BI Community

Solved: Why won't new column added to table show up on Pow... - Microsoft Power BI Community

 

Best Regards,

Liu Yang

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

View solution in original post

4 REPLIES 4
FreemanZ
Super User
Super User

This is indeed a pity, but actually it is suggested to have calculated column as less as possible and try to do the data preparation with Power Query or even from the datasource. 

v-yangliu-msft
Community Support
Community Support

Hi  @Baji_Komara ,

The reason for this is because all the columns displayed in the power bi query come from the original data source. If the measure or column created by dax on the powerbi desktop can only be displayed in the data visual, it will not appear in the power bi query. And Power Query uses another language called M with a very different syntax than DAX.

 

So if you'd like your new column to appear in Power Query, you have to create it in Power Query:

vyangliumsft_0-1671000968753.png

There are also many other features on Power Query that you can check to see if they meet your needs, not necessarily only writing M language..

Query overview in Power BI Desktop - Power BI | Microsoft Learn

 

This is the related document, you can view this content:

Solved: Is there a way to make calculated columns show in ... - Microsoft Power BI Community

Solved: Why won't new column added to table show up on Pow... - Microsoft Power BI Community

 

Best Regards,

Liu Yang

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

SamInogic
Super User
Super User

Hi,

In Power BI, there are two ways of adding custom columns for the table:

  • Create column from Fields Area: These columns will not be available in the Query Editor as they are only accessible within Report not in the Power Query.

    SamInogic_0-1670924256514.png

     

  • Another way is to create the column from Power Query Editor as shown in the below screenshot:

SamInogic_1-1670924256521.png

 

In order to get the columns in the Power Query to unpivot them those need to be created from the Power Query>> Add Column method.

If this answer helps, please mark it as Accepted Solution so it would help others to find the solution.

 

Thanks!

Inogic Professional Services

An expert technical extension for your techno-functional business needs

Power Platform/Dynamics 365 CRM

Drop and email at crm@inogic.com

Service:  http://www.inogic.com/services/  

Power Platform/Dynamics 365 CRM Tips and Tricks:  http://www.inogic.com/blog/

Hi @SamInogic ,

Thanks for your response !

I have calculate columns in data view which are created using complex DAX equtions and functions, not simple arthimetics, if i want to create them in query editor i have to write an M code and i don't know how to write M code to do all those complex calculations. so i want to create those calculated columns in data view want them to appear in query editor to unpivot them.

OR

@SamInogic is there any way to unpivot the columns in data view itself ?

 

Hope you understood my requirement.

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