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
dmbd1904
Helper III
Helper III

Aggregated Averages

Hi, I'm having a lot of trouble with these measures.

 

Basically the measures are calculating the averages correctly at the row level, but not at the aggreagated 'Total'.

 

Inflated Base Rate / Unit (Ave.) =
VAR FXInflation = IFERROR(CALCULATE(MAX('FX Yearly'[data.value]))/CALCULATE(MAX(CapexDB[FX Base Year])),BLANK())
VAR CPIInflation = IFERROR(CALCULATE(MAX('CPI Yearly'[data.value]))/CALCULATE(MAX(CapexDB[CPI Base Year])),BLANK())
VAR REERInflation = IFERROR(CALCULATE(MAX('REER Yearly'[data.value]))/CALCULATE(MAX(CapexDB[REER Base Year])),BLANK())
VAR AveInflation = IFERROR(IF(OR(LASTNONBLANKVALUE(CapexDB[Region],"0")="ANZAC",LASTNONBLANKVALUE(CapexDB[Country],"0")="Argentina"),(FXInflation+REERInflation)/IF(OR(ISBLANK(FXInflation),ISBLANK(REERInflation)),1,2),(FXInflation+CPIInflation)/IF(OR(ISBLANK(FXInflation),ISBLANK(CPIInflation)),1,2)),BLANK())
VAR AdjAveInflation =IF(LASTNONBLANKVALUE(CapexDB[Country],"0")="Bermuda",AveInflation+0.035,IF(LASTNONBLANKVALUE(CapexDB[Country],"0")="Cayman Islands",AveInflation+0.0125,AveInflation))
var _table=(CALCULATE(AVERAGE(CapexDB[Base Rate to USD])))*CALCULATE(AVERAGE('Currency Changer'[Units per USD]),USERELATIONSHIP(CapexDB[Base Currency],'Currency Changer'[Currency code▲▼]))*AdjAveInflation
Return IFERROR(_table,BLANK())
 
 
 
Inflated Converted (Ave.) =
var _table=SUMMARIZE(CapexDB,CapexDB[Unit],CapexDB[Facility Level 1],CapexDB[Facility Level 2],CapexDB[Facility Level 3],"_value",CALCULATE([Inflated Base Rate / Unit (Ave.)])) return
SUMX(_table,[_value])
 
 

 

dmbd1904_0-1602417934482.png

 

I would expect both averages to be 111,720.509

 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @dmbd1904 ,

 

Try to use below measures instead:

Inflated Base Rate_ave=Averagex(values(Index),[Inflated Base Rate/Unit(Ave.)])
Inflated Coverted_ave=Averagex(values(Index),[Inflated Converted(Ave.)])

 

If the above measure still dont work out,pls upload your .pbix file to onedrive business and share the link with us,remember to remove the confidential information.

 

Best Regards,
Kelly

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

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi @dmbd1904 ,

 

Try to use below measures instead:

Inflated Base Rate_ave=Averagex(values(Index),[Inflated Base Rate/Unit(Ave.)])
Inflated Coverted_ave=Averagex(values(Index),[Inflated Converted(Ave.)])

 

If the above measure still dont work out,pls upload your .pbix file to onedrive business and share the link with us,remember to remove the confidential information.

 

Best Regards,
Kelly

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

VijayP
Super User
Super User

@dmbd1904 

Use ISFILTERED Function

IF(ISFILTERED(Column), measure what you have created , average measure to get the overal average)

 

One more suggestion , Instead of using IFERROR in DAX start using Divide which is much better




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


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.