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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
ChiefOfNothing
New Member

Data manipulation, create average across multiple entries

Hi, 

Long time lurker, first time caller...and I've searched but can't figure it out...

 

I have a data set pretty much as below and I'm trying to get an average where the field I'm averaging is already repeated, so a dependent average of an....average. Makes more sense below; 

 

Company Rev. Per MonthMonthrev per ticket
A12001??A
A12001??A
A12002??A2
B24001 
B24001 
C22001 
C22001 

 

In effect I'm trying to work out the average revenue per month per ticket given the above, so for ??A = 600, ??A2 = 1200 etc. The repeating rev number is throwing me off as I can't get it to divide by the count to get the rev per customer per month, before I do the rev/customer/ticket....

 

Hopefully that makes some sense to someone? I should add it's a simple excel upload

3 ACCEPTED SOLUTIONS
TheoC
Super User
Super User

Hi @ChiefOfNothing 

 

You can use the following measure to achieve what you're after:

 

Avg by Group = CALCULATE ( AVERAGE ( 'Table'[Revenue] ) , ALLEXCEPT ( 'Table' ,'Table'[Company] ,'Table'[Month] ) )

Output of an example is below with attached PBIX file:

 

TheoC_0-1646087903560.png

In the example above, I used Category and Year.  You can change these as you require by adjusting the measure.

 

Hope this helps!

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=DIVIDE(Data[Rev. Per Month],CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Company]=EARLIER(Data[Company])&&Data[Month]=EARLIER(Data[Month]))))

Hope this helps.

Untitled.png


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

View solution in original post

TheoC
Super User
Super User

 

Hi @ChiefOfNothing 

 

You can use the following measure to achieve what you're after:

 

Avg by Group = CALCULATE ( AVERAGE ( 'Table'[Revenue] ) , ALLEXCEPT ( 'Table' ,'Table'[Company] ,'Table'[Month] ) )

Output of an example is below with attached PBIX file:

 

TheoC_0-1646094392834.png

 

In the example above, I used Category and Year.  You can change these as you require by adjusting the measure.

 

Hope this helps!

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

7 REPLIES 7
TheoC
Super User
Super User

 

Hi @ChiefOfNothing 

 

You can use the following measure to achieve what you're after:

 

Avg by Group = CALCULATE ( AVERAGE ( 'Table'[Revenue] ) , ALLEXCEPT ( 'Table' ,'Table'[Company] ,'Table'[Month] ) )

Output of an example is below with attached PBIX file:

 

TheoC_0-1646094392834.png

 

In the example above, I used Category and Year.  You can change these as you require by adjusting the measure.

 

Hope this helps!

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Thank you! Now to manipulate that into what I want as an end goal, I'll try and work that one out myself. I'm normally pretty solid on excel, but this feels like a new language!  Thank you!

@ChiefOfNothing You're welcome! DAX is definitely different to Excel in many instances, but keep at it because it is a very logical language and you'll learn to love it (and... possibly occasionally hate it haha). Let us know if you need any help or guidance if you get stuck! All the best! Theo 😃 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=DIVIDE(Data[Rev. Per Month],CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Company]=EARLIER(Data[Company])&&Data[Month]=EARLIER(Data[Month]))))

Hope this helps.

Untitled.png


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

Thanks Ashish, looks like multiple ways to do the same thing and on my own I failed to find any of them!!

You are welcome.


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

Hi @ChiefOfNothing 

 

You can use the following measure to achieve what you're after:

 

Avg by Group = CALCULATE ( AVERAGE ( 'Table'[Revenue] ) , ALLEXCEPT ( 'Table' ,'Table'[Company] ,'Table'[Month] ) )

Output of an example is below with attached PBIX file:

 

TheoC_0-1646087903560.png

In the example above, I used Category and Year.  You can change these as you require by adjusting the measure.

 

Hope this helps!

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.