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

Calculated average not changing reference

Hello,

 

I suppose I am still new to Power BI in this forum to perhaps my question is easy for some.

Still I have played with this issue for days now and I cannot seem to solve it desite browsing myself blue in the face.

 

I got 2 data sets linked through 1 to many ID (Activity ID).

NotSoPowerUser_2-1633221104836.png

Now, I can sum the revenue in Table 2 by something like below which works fine.

Calculate(Sum(Table2[Revenue]),Filter(Table2,Table2[Activity ID]=Table1[Activity ID])).

However since both tables are being sliced dynamically I cannot actully copy data from table 2 to table 1. 

So I have to use a measure. Now if I plot the average revenue from the above formula I get something completely different reason being the average revenue is reference the product and not the Activity. Not right or wrong I just need it the other way round. 

NotSoPowerUser_3-1633221304057.png

I have tried a lot of function with SumX, Summarize etc.. I am getting diffent results compared to the alternative fasion using a spreadsheet. I suppose I have learned a lot in the process between tables vs Measures, graphics interface etc. but I am still learning.

Can anway advise please how I make the average Revenue data in a Measure reference the activity..... at least I think that is the issue. 

 

Kind regards

Alex 

1 ACCEPTED SOLUTION
NotSoPowerUser
Frequent Visitor

Hello,

 

I managed to figure this our myself. I should have used this forum to start with rather than using a search browser. So thanks to everyone for contributing to this forum.

 

So to change the calculated average Price per something else I suppose the logic is simple.

Sum all the Prices together in a Calculate(Sum( Table2[Revenue])) then average them out over a different parameter using AverageX(Values('new parameter',Sum) so the total expression will look like this:

AverageX(Values(Table1[Activity],Calculate(Sum( Table2[Revenue])))

 

Thanks and regards

Alex

View solution in original post

1 REPLY 1
NotSoPowerUser
Frequent Visitor

Hello,

 

I managed to figure this our myself. I should have used this forum to start with rather than using a search browser. So thanks to everyone for contributing to this forum.

 

So to change the calculated average Price per something else I suppose the logic is simple.

Sum all the Prices together in a Calculate(Sum( Table2[Revenue])) then average them out over a different parameter using AverageX(Values('new parameter',Sum) so the total expression will look like this:

AverageX(Values(Table1[Activity],Calculate(Sum( Table2[Revenue])))

 

Thanks and regards

Alex

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.