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

Create a PowerQuery Column That References Entire Table

I’m trying to create a new column that references each rows values compared to that of the entire table in power query.  For example, I have a table of students, their study time (broken down into groups or less than 3 hours, 3-6 hours and > 6 hours) and their grades on an exam (each row is a student).   I’m trying to create a new column that renders the predicted test grade based solely off of their study time value (so if their study time is less than 3 hours for example, the value of the new column for that row would be the average exam score over the whole table for all rows that had a study time of less than 3 hours).  How can I create a new column that achieves this and filters the entire table based on each rows value?

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

Hi  @Ad550 ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want.

yingyinr_0-1665136299223.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regard

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

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi  @Ad550 ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want.

yingyinr_0-1665136299223.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regard

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

@Ad550 ,

 

I know your question is to build it in power query but I think this would be more efficient as a measure. Does it have to be in power query?



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

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