This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I am sure powerbi can do what excel can 🙂 I am just doing it wrong.
Goal: calculate the geometric mean for a group of return values.
I have the values, but fail to get the correct geomean in Power BI.
I know that in year 1 I have no value for return and must exclude blanks.
There is of course the alternative, multiply all year values = F, then power (F, (1/number of values not blank)). but that is just the same what geomean does.
1. How do I solve it
2. Where am I going wrong in my thinking of the measure
Excel:
Power BI:
I tried first, but expect I need a table instead a measure.
Solved! Go to Solution.
You've got a couple of issues. First, you calculate _ret once and use that same single value for each year. Second, I think you need 1 + _ret inside your GEOMEANX.
Try this:
TWR =
VAR _YearReturns_ =
ADDCOLUMNS ( VALUES ( Data[Year End] ), "@Return", [Return] )
VAR _NonBlank_ =
FILTER ( _YearReturns_, NOT ISBLANK ( [@Return] ) )
VAR _Geomean =
GEOMEANX ( _NonBlank_, 1 + [@Return] )
RETURN
IF ( NOT ISBLANK ( _Geomean ), _Geomean - 1 )
I think I got it.
I changed the geomeanx to the dates table instead the data table and it worked.
Hi, how did you define the geomean values column? or is it a measure, anyway can you give more information
You've got a couple of issues. First, you calculate _ret once and use that same single value for each year. Second, I think you need 1 + _ret inside your GEOMEANX.
Try this:
TWR =
VAR _YearReturns_ =
ADDCOLUMNS ( VALUES ( Data[Year End] ), "@Return", [Return] )
VAR _NonBlank_ =
FILTER ( _YearReturns_, NOT ISBLANK ( [@Return] ) )
VAR _Geomean =
GEOMEANX ( _NonBlank_, 1 + [@Return] )
RETURN
IF ( NOT ISBLANK ( _Geomean ), _Geomean - 1 )
Your suggestion also works, IF i reference the dates table instead the data table.
I had ommited the model in my initial post, so that information was missing.
Appologies.
By the way, I cannot add the pbix file, file type not supported, perhaps my level too low to post attachements. Can share via cloud link if that makes it easier.
I think I got it.
I changed the geomeanx to the dates table instead the data table and it worked.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 28 | |
| 26 | |
| 25 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 53 | |
| 47 | |
| 22 | |
| 19 | |
| 18 |