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

calculate average taking just one value per period

Hi experts

I need help to calculate the average of a column but considering just one value per category (another column)

 

I have a table like this

 

Date      Value

Feb        94

Feb        94

Feb        94

Mar       96

Mar       96

 

If I calculate the average of the values I get 94.8.

I need a column or meassure that can give me the average of 1 value from february and 1 value from march (it always will be the same repeated value per month) so the result in this example would be=

(94+96)/2=95

 

Thanks in advance

 

 

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@raulogv ,

 

Create a measure using dax as below:

Result =
CALCULATE ( AVERAGE ( Table[Value] ), DISTINCT ( Table ) )

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

@raulogv ,

 

Create a measure using dax as below:

Result =
CALCULATE ( AVERAGE ( Table[Value] ), DISTINCT ( Table ) )

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

Try like

averagex(SUMMARIZE(table,table[month],"_max",max(table[Value])),[_max])

 

In case it is the month and you have data at the date level, you can create a month in a table or join to date dimension and have moth there.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

Greg_Deckler
Super User
Super User

Use SUMMARIZE, GROUPBY or SUMMARIZECOLUMNS to first calculate the AVERAGE or AVERAGEX of each month, then take the average of those values.


@ 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...

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.