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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.