cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nailifarhanah Frequent Visitor
Frequent Visitor

Calculate average from prior months

Hi, 

 

I am relatively new to power bi. So was hoping someone can help me out to do this.

 

I have a monthly sets of data and I need to calculate the average for the current month, using the previous month and current month.

How do i achive this using measures? or do i need to calculate under 'edit queries' and how?

MonthAmountAverage

Jan

2000

-

Feb8001400
March 600700
April1000800

 

Appreciate anyone's help on this.

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
az38 Super Contributor
Super Contributor

Re: Calculate average from prior months

Hi   @nailifarhanah

first, its not a good idea to keep only month name in the Month field. for example, you could use last day of month here

if so, then you will need to create a measure (not query editor mode)

Average = (calculate(sum(Table1[Amount]);PREVIOUSMONTH(Table1[Month]))+calculate(sum(Table1[Amount]);ALLEXCEPT(Table1;Table1[Month])))/2 

do not hesitate to give a kudo to useful posts and mark solutions as solution

 

 

View solution in original post

1 REPLY 1
az38 Super Contributor
Super Contributor

Re: Calculate average from prior months

Hi   @nailifarhanah

first, its not a good idea to keep only month name in the Month field. for example, you could use last day of month here

if so, then you will need to create a measure (not query editor mode)

Average = (calculate(sum(Table1[Amount]);PREVIOUSMONTH(Table1[Month]))+calculate(sum(Table1[Amount]);ALLEXCEPT(Table1;Table1[Month])))/2 

do not hesitate to give a kudo to useful posts and mark solutions as solution

 

 

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)