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

Average of measure with Calculate

Dear all,

 

I have this expression: 

 

TAM Amount = CALCULATE(    
         SUM(CifSales[Amount]);
         DATESINPERIOD(CalendarTable[DateKey];LASTDATE(CalendarTable[DateKey]);-12;MONTH)
         )

This, calculate the TAM amount of my sales table (reference date is november 2017). The result its as follows:

TAM AmountTAM AmountWith this, I need to obtain the average value of those 12 records. The correct amount is 11,834,775.87

I have tried several forms of Average and none of them works for me. ¿Can you please help me?

 

Thanks in advance!

 

Best regards,

Antonio.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Sage
Solution Sage

Re: Average of measure with Calculate

AVERAGEX ( SUMMARIZE( CalendarTable;'CalendarTable'[Year]; CalendarTable[ShortMonthName] ); [TAM Amount] )

View solution in original post

7 REPLIES 7
Highlighted
Super User V
Super User V

Re: Average of measure with Calculate

Hi @Achamorroman,

 

You need to use an AveregeX expression add another measure like this:

 

Average on total =
IF (
    HASONEVALUE ( Calendar[Years] );
    [TAM Amount];
    AVERAGEX ( ALL ( 'Calendar'[Year]; Calendar[ShortMonthName] ); [TAM Amount] )
)

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





Highlighted
Frequent Visitor

Re: Average of measure with Calculate

Hi @MFelix, thanks for fast reply!

 

Unfortunately, that formula doesn't fit what I need. This is the result:

image.png

The line result is the same, but total doesn't work. 

 

Thanks again for your help!

Regards

A.Chamorro 

 

 

Highlighted
Frequent Visitor

Re: Average of measure with Calculate

Hi again,

 

I found this great article about Rolling 12 Months Average in DAX. I'm going to test it now, it seems to be a solution!

 

Regards!

A.Chamorro. 

Highlighted
Community Support
Community Support

Re: Average of measure with Calculate

@Achamorroman,

 

You may use a similar way as shown here.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Solution Sage
Solution Sage

Re: Average of measure with Calculate

AVERAGEX ( SUMMARIZE( CalendarTable;'CalendarTable'[Year]; CalendarTable[ShortMonthName] ); [TAM Amount] )

View solution in original post

Highlighted
Super User V
Super User V

Re: Average of measure with Calculate

Hi @Achamorroman,

 

What result are you expecting?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Highlighted
Frequent Visitor

Re: Average of measure with Calculate

Hi @Ashish_Mathur,

 

I need one graphic as follows:

 

  • Always 12 months before selected month and year on a slicer.
  • Each month represent the Moving annual totals (MAT).
  • Total of the matrix should be the sum of that 12 months divided by 12

From now, thanks to @mattbrice (its formula works!) I have the right total, but I don't know how can I obtain always those 12 months having a slicer as reference.

 

Any help would be very appreciated

Thanks!

 

 

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Kudoed Authors