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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
phumengam
Regular Visitor

Create a new table from the average value of each columns

Hi All,

 

I am trying to create a new table to display on the report where each row consists of column name and the average value of that column. See the pic, https://ibb.co/hcRTkg5

 

My original data would look something like this:

 

Factor 1 | Factor 2 | Factor 3

-------------------------------

      1      |        2     |       4     |

      9      |        6     |       3     |

      1      |        7     |       1     | 

 

 

The output table that I am looking for would look like this:

Factors |  Scores |

-------------------

Factor1 | Average(Factor1) |

Factor2 | Average(Factor2) |

Factor3 | Average(Factor3) |

 

 

I followed this link: https://community.powerbi.com/t5/Desktop/Create-table-from-measures/m-p/275686 but it doesn't seem to work.  Here is my code: 

````

Table =
UNION(ROW("Factor","Factors","Score", "Scores")
, ROW("Factor","Factor1","Score", [avg_1])
, ROW("Factor","Factor2","Score", [avg_2])
, ROW("Factor","Factor3","Score", [avg_3]))

```

This is the error message I received: "the expression refers to multiple columns. multiple columns cannot be converted to a scalar value"

 

Thanks.

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@phumengam , Try like given below

 

Table =
UNION(
ROW("Factor","Factor1","Score", [avg_1])
, ROW("Factor","Factor2","Score", [avg_2])
, ROW("Factor","Factor3","Score", [avg_3]))

 

 

Have you explored option, "Show on Row" in Matrix, which can show measure on row

https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/

 

Another option is to unpivot or transpose the table 

https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

You should create a new table instead of a new column in order for this code to work.

 

FarhanAhmed_0-1611556327551.png

 







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

Proud to be a Super User!




View solution in original post

8 REPLIES 8
FarhanAhmed
Community Champion
Community Champion

Try This to create new table.

 

Table = 
UNION(
 ROW("Factor","Factor1","Score", AVERAGE(Factor[Factor 1 ]))
, ROW("Factor","Factor2","Score", AVERAGE(Factor[ Factor 2 ]))
, ROW("Factor","Factor3","Score", AVERAGE(Factor[ Factor 3])))

  







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

Proud to be a Super User!




Do you by any chance know if we can make the filter work with this table measure?

 

All data (no filter):

phumengam_0-1611614794463.png

Applying a filter: The filter is working with card but it doesn't work with the measure table. 

phumengam_1-1611614808384.png

 

Do you know if we can apply the filter on this table?

 

 

I received the same error.

phumengam_0-1611553332957.png

Note that my table is called "ee_Data modeling_result" and the columns are called score_v1, score_v2,...

 

Here is what my sample data looks like: 

phumengam_1-1611553506511.png

 

 

You should create a new table instead of a new column in order for this code to work.

 

FarhanAhmed_0-1611556327551.png

 







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

Proud to be a Super User!




This works!  I have spent quite a few hours on this.  Thanks a lot, @FarhanAhmed.

amitchandak
Super User
Super User

@phumengam , Try like given below

 

Table =
UNION(
ROW("Factor","Factor1","Score", [avg_1])
, ROW("Factor","Factor2","Score", [avg_2])
, ROW("Factor","Factor3","Score", [avg_3]))

 

 

Have you explored option, "Show on Row" in Matrix, which can show measure on row

https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/

 

Another option is to unpivot or transpose the table 

https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank for your response. 

 

1. When I tried the code, I received the same error. 

 

2. I'm not sure how can I leverage the "Show on Row". I think that I still need to construct a table of summary statistic first then I can do the "Show on Row".

 

3. I was thinking about pivoting the data but I have other visualization objects that relies on the same data. So, is it possible to create seperate pivot table that can be linked back to the original table?

@phumengam , The first one should not give an error, if you are creating a table.

Put these three measures on matrix value, And use show on row and check

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors