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
Anonymous
Not applicable

Average a sum over specific date range

Hello,

 

I've got a measure which sums up three columns. If I'm looking at a single month then for example it brings back a value of 4000. 

 

What I want to do is if the user selects a date range of more than one month then show the average of that time period as well as being able to show the single month value if a single month is selected.

 

EG March = 3000

Feb = 2000

Jan = 4000

 

Currently when I select last 3 calendar months it'll show 9,000 however I want it to show 3,000 which is the average over 3 months but then revert back to showing 4,000 if just January is selected.

 

Can this be done in a single column or will I have to have it on a seperate one. Sorry it's not a very good explaination!

 

Thanks,

 

Mark

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Simple avg should do?

Average(Table[Value])

In case data need to aggregate before
AverageX(Summarize(Table,Table[Month],"_1",sum(Table[Value])),[_1])

View solution in original post

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi  @Anonymous 

 

you might consider creating pbix file that will contain some sample data (remove the confidential info), upload the pbix to onedrive for business and share the link to the file. Please do not forget to describe the expected results based on this sample data.

 

 

Community Support Team _ Dina Ye
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

@Anonymous , Simple avg should do?

Average(Table[Value])

In case data need to aggregate before
AverageX(Summarize(Table,Table[Month],"_1",sum(Table[Value])),[_1])

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.