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

How to append calculated fields which is not in query editor

Hello,

 

I having some issues with some of my calculated fields when I am trying to append a few tables.

 

Firstly, I create some calculated fields in which I use the function "related" as some of the fields are in different tables. These calcualated fields are calculating a score for a KPI. This had to be done in 3 different tables which have different data.

 

Afterwards, I need to bring all my 3 tables (which have their own score KPI) into one single table in order to bring all 3 KPI from the 3 tables and calculate the average KPI of the three KPIs.

 

The issue is that I cannot perform my calculations in query editor (cannot use related function there), therefore when I am trying to append the three tables I am losing the calculated fields for KPI score.

 

Do you have any suggestions to resolve my issue??

 

Thanks in advance!

1 ACCEPTED SOLUTION

hi, @Anonymous

After my test, I'm afraid it is difficult to achieve in the modeling process.

It's better to do this in Edit Queries, 

If the calculate column could be done after appending query?

or use M language in Edit Queries to add a custom column instead of calculate column?

 

Could you please share some simple sample data with the true data structure and expected output. Do mask sensitive data before uploading.

 

 

Best Regards,

Lin

Community Support Team _ Lin
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

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi, @Anonymous

Action in query editor is based on M language, and it is for the data source.

Action in data view of is based on DAX Function, and it is for data model.

 calculate column or calculate table are based on the DAX, so can be applied in the query editor.

There are usually two methods for you to refer to:

1. If the three tables have same columns and same column order, you use UNION to append the three tables.

2. You could use merge tables in query editor and then get the "related" to add a custom column, then append table in query editor.

 

If it is not your case, please share a simple sample pbix file and expected output.  Do mask sensitive data before uploading.

 

 

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hello @v-lili6-msft,

 

Many thanks for your response. I will prepare a pbix file and send it to you soon. Before doing this I would like to know if there is the capability in Power BI to load multiple tables, then create some calculated fields on DAX and after this append all these tables into one single table which will include the calculated fields I created in each table before the tables' consolidation. 

 

 

Please see below an image where I have an example for you.

Capture.PNG

 

I am trying to append all 3 tables but I cannot have the calculated fields created in DAX into my consolidated table (i.e. in the example above I don't have the calc.1 and calc.2 in my consolidated table).

hi, @Anonymous

After my test, I'm afraid it is difficult to achieve in the modeling process.

It's better to do this in Edit Queries, 

If the calculate column could be done after appending query?

or use M language in Edit Queries to add a custom column instead of calculate column?

 

Could you please share some simple sample data with the true data structure and expected output. Do mask sensitive data before uploading.

 

 

Best Regards,

Lin

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

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.