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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Arghya
Frequent Visitor

Create a Table from existing unrelated tables

Dear All, 

I am completely new in Power BI and as a learner I am resorting to this community for getting help.

I have the following tables

Table_Jan

Net Bill Amnt            Billed Units

200                            100

300                            500

 

Table_Mar

Net Bill Amnt            Billed Units

230                            122

412                            398

 

Table_June

Net Bill Amnt            Billed Units

124                           115

78                             225

 

Essentially there are three tables as above and each represents monthly data like Jan, Mar and June

 

What I want is 

 

Table_New

Month         Avg. Net Bill Amnt                                                                 Avg. Billed Units

Jan              AVERAGE(Table_Jan[Net Bill])                                        AVERAGE(Table_Jan[Billed Units])

Mar            AVERAGE(Table_Mar[Net Bill])                                        AVERAGE(Table_Mar[Billed Units])

June           AVERAGE(Table_Jun[Net Bill])                                         AVERAGE(Table_Jun[Billed Units])

 

How can Accomplish this in Power BI??

 

Please help. 

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

 

Using the Append feature of Query Editor, first append data from all three Tables and also have a column for Date (may be the dirst date of the month).  Create a Calendar table with an additional month column.  Create a relatioship from the Date column of the Data Table to the Date column of the Calendar Table.  Once that is done, you can simply drag the month column from the Calendar Table and then write the AVWRAGE() formulas.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Community Champion
Community Champion

First, kudos for taking the time to properly ask your question! 

 

Second, see if this works:

 

Table = 
VAR tmpJan = ADDCOLUMNS(Table_Jan,"Month","Jan")
VAR tmpMar = ADDCOLUMNS(Table_Mar,"Month","Mar")
VAR tmpJune = ADDCOLUMNS(Table_June,"Month","June")
VAR tmpTable = UNION(tmpJan,UNION(tmpMar,tmpJune))
RETURN GROUPBY(tmpTable,[Month],
                "Avg. Net Bill Amnt",AVERAGEX(CURRENTGROUP(),[Net Bill Amnt]),
                "Avg. Billed Units",AVERAGEX(CURRENTGROUP(),[Billed Units])
        )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks!!

So I follow the steps as shown below

1. In modelling Tab, I click on New Table

2. And then in formula bar, I type what you have mentioned. 

 

I am getting error because I of the follwoing reasons

"UNION command can't be used with tables of different column numbers"

 

How to tackle this?

 

Regards,power bi error.png

The error I see is about AVERAGEX and seems like you need to change your column type from Text to Numeric.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks!!

So I follow the steps as shown below

1. In modelling Tab, I click on New Table

2. And then in formula bar, I type what you have mentioned. 

 

I am getting error because I of the follwoing reasons

"UNION command can't be used with tables of different column numbers"

 

How to tackle this?

 

Regards, 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors