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
TWMY1014
Helper II
Helper II

Translate future 3 yrs Geomean formula (from excel) to calculated column (in Power BI)

Hi Experts,

 

As per title, the excel formula for calculate (-5.85) from above 3 cells (-7.43, -4.69 -5.39) was below:

 =GEOMEAN(1+(AP36:AR36)/100)-1)*100

TWMY1014_0-1664452857026.png

 

I've try to convert in calculated column in below but fail :

******

test =
var MinYear = '**DM-RealEstatePriceIndicator**'[Year]
var MaxYear = MinYear+2
var After3YrGeomean = CALCULATE(GEOMEAN('**DM-InvestabilityIndex**'[Value]), AND('**DM-RealEstatePriceIndicator**'[Year]>=MinYear,'**DM-RealEstatePriceIndicator**'[Year]<=MaxYear),ALLEXCEPT('**DM-RealEstatePriceIndicator**','**DM-RealEstatePriceIndicator**'[CITY],'**DM-RealEstatePriceIndicator**'[Type]))
return
After3YrGeomean
******
Part of the table image was below for your reference:
TWMY1014_1-1664453123260.png

 

Thanks a lot.

 

 

2 REPLIES 2
Greg_Deckler
Super User
Super User

@TWMY1014 Maybe try:

test =
var MinYear = '**DM-RealEstatePriceIndicator**'[Year]
var MaxYear = MinYear+2
var Types = DISTINCT('**DM-RealEstatePriceIndicator**'[Type])
var Cities = DISTINCT('**DM-RealEstatePriceIndicator**'[CITY])
var Table = FILTER(ALL('**DM-RealEstatePriceIndicator**'), AND('**DM-RealEstatePriceIndicator**'[Year]>=MinYear,'**DM-RealEstatePriceIndicator**'[Year]<=MaxYear) && '**DM-RealEstatePriceIndicator**'[CITY] IN Cities && '**DM-RealEstatePriceIndicator**'[Type] IN Types)
return
GEOMEANX(__Table,[Value])

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi Greg, 

 

Thanks a lot for your prompt response. 

However, it still shows 0. 

TWMY1014_0-1664455732043.png

 

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.