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

Creating a new table based on calculations performed on rows from another table

Hi,

I have a table containing a 'Transaction_ID' coumn along with a 'price' column, such as below:

Transaction_IDprice
112
113
115
2...etc. 

 

There can be several rows of this table containing the same transation IDs and I'd like to create a new table which asseses the rows and calculates the average price for each transaction, the minimum price...etc.:

Transaction_IDaverage priceminimum price
1  
2  
3  

 

I'd greatly appreciate any help with this. Many thanks.

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @boddydan ,

 

You have two options:

Power Query - M Language

  • Create a new table that references the first one

MFelix_0-1633348895003.png

  • Go to Transform Group by
  • Select the Group by ID and the average of the price:

MFelix_1-1633348961891.png

 

MFelix_2-1633348977878.png

 

DAX

  • Add a new calculated table with the following code:

MFelix_3-1633349163778.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
v-xiaoyan-msft
Community Support
Community Support

Hi @boddydan ,

 

Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thank you very much for your kind cooperation!

 

Hope it helps,


Community Support Team _ Caitlyn

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

MFelix
Super User
Super User

Hi @boddydan ,

 

You have two options:

Power Query - M Language

  • Create a new table that references the first one

MFelix_0-1633348895003.png

  • Go to Transform Group by
  • Select the Group by ID and the average of the price:

MFelix_1-1633348961891.png

 

MFelix_2-1633348977878.png

 

DAX

  • Add a new calculated table with the following code:

MFelix_3-1633349163778.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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