Forum Discussion
Data manipulation, create average across multiple entries
- 4 years ago
Hi Anonymous
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:
In the example above, I used Category and Year. You can change these as you require by adjusting the measure.
Hope this helps!
Theo
- 4 years ago
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.
- 4 years ago
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:
In the example above, I used Category and Year. You can change these as you require by adjusting the measure.
Hope this helps!
Theo
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!
Anonymous 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 😃