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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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.


Follow on LinkedIn
@ 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.