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 Measures (Monthly & Yearly) are not working properly

Hello! So I am creating two measures that will calculate the average monthly & yearly from total cost for fiscal month/year. It seems to be just cacluating the total cost and duplicating the values for each month but if you look at the sum totals they are different. Could it but the [Fiscal Year] or [Fiscal Month Name], can anyone provide some assistance?    

powerbi_average.PNG

 

NPD_ST_AVGMonthly = 
AVERAGEX(
    VALUES('Date'[Fiscal Month Name]),
    [NPD_ST_TotalCost]
    )

NPD_ST_AVGYearly = 
AVERAGEX(
    VALUES('Date'[Fiscal Year]),
    [NPD_ST_TotalCost]
    )

NPD_ST_TotalCost = SUM('NP_SP_ST_Combined'[Materials Cost]) + SUM('NP_SP_ST_Combined'[Labor Cost])

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

 

This will always duplicate because FY2015 will always be 1 value and hence it will be same. So ideally the measure should be same for all months and years because it is average.

 

1. Averagex(all(fiscal year),total cost.

 

2. Averagex(all(Month Name),Total Cost.

 

Please mark solution if this works with you.

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous 

 

This will always duplicate because FY2015 will always be 1 value and hence it will be same. So ideally the measure should be same for all months and years because it is average.

 

1. Averagex(all(fiscal year),total cost.

 

2. Averagex(all(Month Name),Total Cost.

 

Please mark solution if this works with you.

 

 

amitchandak
Super User
Super User

@Anonymous , not sure what is wrong with monthly

may be you need this

NPD_ST_AVGMonthly=
calculate(AVERAGEX(
VALUES('Date'[Fiscal Month Name]),
[NPD_ST_TotalCost]
), filter(all('Date') , 'Date'[Fiscal Year] =max('Date'[Fiscal Year])))

 

or this you need for yearly

 

NPD_ST_AVGYearly =
calculate(AVERAGEX(
VALUES('Date'[Fiscal Month Name]),
[NPD_ST_TotalCost]
), filter(all('Date') , 'Date'[Fiscal Year] =max('Date'[Fiscal Year])))

 

or you need for yearly

 

NPD_ST_AVGYearly =
calculate(AVERAGEX(
VALUES('Date'[Fiscal Year]),
[NPD_ST_TotalCost]
),all('Date') )

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.