Forum Discussion
MrBuchanan
Apr 28, 2023Copper Contributor
Excel Pivot Table - Power Pivot - Average Help
This is my sample table data, and my pivot table. I am trying to get the pivot table to show the average duration it took for the two applications to get approved, 75.5 days. I created a pivot ...
- Apr 28, 2023
Lorenzo But what if another ID also has a duration of 31 days? Then the average should become (31+31+120)/3 = 60,67
You'll need a measure that takes distinct ID's into account. Not just distinct duration values. Such a measure would look like this:
=AVERAGEX(DISTINCT(SELECTCOLUMNS('Table', "ID", 'Table'[ID], "value", 'Table'[value])), [value])
Riny_van_Eekelen
Apr 28, 2023Platinum Contributor
Lorenzo But what if another ID also has a duration of 31 days? Then the average should become (31+31+120)/3 = 60,67
You'll need a measure that takes distinct ID's into account. Not just distinct duration values. Such a measure would look like this:
=AVERAGEX(DISTINCT(SELECTCOLUMNS('Table', "ID", 'Table'[ID], "value", 'Table'[value])), [value])
Lorenzo
Apr 28, 2023Silver Contributor
Hello Riny_van_Eekelen
I realized that after posting and was going to look at fixing my bad => Thanks for doing it
(no idea why but it seems I can't delete a post here, will revise it...)