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
ermuelle
Regular Visitor

Calculating average over multiple tables

I am trying to calculate a total monthly average from data in two seperate tables. This seems like it should be easy, but I cannot figure out the proper DAX formula. Please help! Here's what the data looks like. How do I connect these 2 tables so that I can calculate the overall monthly average of both managed and referred satisfaction? Basically I want a line chart that has the average managed satisfaction, the average referred satisfaction and then the total satisfaction by month. Thank you in advance.

 

Table 1 - Managed Satisfaction

Date                             Score

July 1, 2017                  3

July 2, 2017                  4

August 28, 2017          2

 

Table 1 - Referred Satisfaction

Date                            Score

July 14, 2017               5 

August 3, 2017            1

1 ACCEPTED SOLUTION

Hi,

 

You must create a calendar table and create a relationship from the Date column of the appended table to the date column of the Calendar Table.  In the Calendar Table use the =FORMAT(Calendar[Date],"mmmm") formula to extract the month name from the Date and =YEAR(Calendar[Date]) to extract the Year.  In your visual, drag the Year and Month from the Calendar Table.

 

Hope this helps.


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

View solution in original post

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

 

In each table, create another column titled Type of satisfaction.  Using Query Editor, append both Tables and then create your desired visual with this simple measure

 

=SUM(Data[Score])

 

Hope this helps.


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

I would probably use something like:

 

AVERAGEX(UNION(Table1,Table2),[Score])

@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks. I've tried this, but I only get the overall average across the time period. I can't look at it by month. I want to be able to look at the total average (referred + managed satisfaction) by month.

Hi,

 

You must create a calendar table and create a relationship from the Date column of the appended table to the date column of the Calendar Table.  In the Calendar Table use the =FORMAT(Calendar[Date],"mmmm") formula to extract the month name from the Date and =YEAR(Calendar[Date]) to extract the Year.  In your visual, drag the Year and Month from the Calendar Table.

 

Hope this helps.


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

Thank you! I think I found a solution.

Hi!

I know it's been ages since this post. But would you happen to have the pbix file? I have almost the exact same question

@ermuelle,

 

By the way, you may help accept solution. Your contribution is highly appreciated.

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

You are welcome.


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

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.