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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

calculating last year average to add in a pivot table

Hi All, 

 

I would appreciate your help on a measure that I have spent several days trying to add to a pivot table. 

 

I would like to calculate last year (2018) average nb of leads, using the data format below. I have tried to use several DAX formulas but nothing worked.

image.png

My aim is to recreate the following pivot table: 

image.png

Many thanks in advance. 

 

Veronica

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank you for taking the time to get back to me. Unfortuantely, the formula returns an incorrect average.

 

I have checked and no filters were applied. The above formula seems to return a monthly average for 2018.

 

I found that the following DAX formual works:

 

2018 AVG Leads= CALCULATE (

                                  SUM ( Table[Leads(nb) by Channel]),

                                  FILTER(Table, AND (Table[Date],(Table[Year]=2018))))/12

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

You may create a measure using DAX like pattern below:

 

Result =
CALCULATE (
    AVERAGE ( Table[Leads(nb) by Channel] ),
    FILTER ( Table, YEAR ( Table[Date] ) = YEAR ( TODAY () ) - 1 )
)

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.

Anonymous
Not applicable

Thank you for taking the time to get back to me. Unfortuantely, the formula returns an incorrect average.

 

I have checked and no filters were applied. The above formula seems to return a monthly average for 2018.

 

I found that the following DAX formual works:

 

2018 AVG Leads= CALCULATE (

                                  SUM ( Table[Leads(nb) by Channel]),

                                  FILTER(Table, AND (Table[Date],(Table[Year]=2018))))/12

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.