Forum Discussion
Calculate Average Based on Two Categories
that is not correct, you should create this column in your fact table but use the library table in lookup. I mean this....
lookupvalue('Filters'[library visits per capita],'Filters'[Library], 'Fact'[Library])
Okay-- the "library visits per capita" values are in the facts table, not the filters table. That formula did not work.
I have tried something different, I used a formula to concatenate the population and revenue brackets so that now there is only one dimension I would need to focus on:
Would this make the calculation easier?
| Library | Population | Revenue | Population and Revenue | Mean Visits Per Capita by Population and Revenue |
| Beta | 100,000 and Up | 10,000 and Under | 100,000 and Up & 10,000 and Under | 27.11 |
| Sigma | 100,000 and Up | 100,000 and Up | 100,000 and Up & 100,000 and Up | 39.84 |
| Tau | 100,000 and Up | 100,000 and Up | 100,000 and Up & 100,000 and Up | 39.84 |
| Epsilon | 100,000 and Up | 50,000 to 100,000 | 100,000 and Up & 50,000 to 100,000 | 28.28 |
| Rho | 100,000 and Up | 50,000 to 100,000 | 100,000 and Up & 50,000 to 100,000 | 28.28 |
| Alpha | 20,000 and Under | 10,000 and Under | 20,000 and Under & 10,000 and Under | 26.4025 |
| Lambda | 20,000 and Under | 10,000 and Under | 20,000 and Under & 10,000 and Under | 26.4025 |
| Mu | 20,000 and Under | 10,000 and Under | 20,000 and Under & 10,000 and Under | 26.4025 |
| Upsilon | 20,000 and Under | 10,000 and Under | 20,000 and Under & 10,000 and Under | 26.4025 |
| Eta | 20,000 and Under | 100,000 and Up | 20,000 and Under & 100,000 and Up | 22.42 |
| Gamma | 20,000 and Under | 50,000 to 100,000 | 20,000 and Under & 50,000 to 100,000 | 26.15 |
| Delta | 20,000 and Under | 50,000 to 100,000 | 20,000 and Under & 50,000 to 100,000 | 26.15 |
| Zeta | 20,000 and Under | 50,000 to 100,000 | 20,000 and Under & 50,000 to 100,000 | 26.15 |
| Phi | 20,000 and Under | 50,000 to 100,000 | 20,000 and Under & 50,000 to 100,000 | 26.15 |
| Psi | 20,000 and Under | 50,000 to 100,000 | 20,000 and Under & 50,000 to 100,000 | 26.15 |
| Omega | 20,000 and Under | 50,000 to 100,000 | 20,000 and Under & 50,000 to 100,000 | 26.15 |
| Nu | 20,000 to 100,000 | 10,000 and Under | 20,000 to 100,000 & 10,000 and Under | 39.23 |
| Theta | 20,000 to 100,000 | 100,000 and Up | 20,000 to 100,000 & 100,000 and Up | 17.3375 |
| Iota | 20,000 to 100,000 | 100,000 and Up | 20,000 to 100,000 & 100,000 and Up | 17.3375 |
| Kappa | 20,000 to 100,000 | 100,000 and Up | 20,000 to 100,000 & 100,000 and Up | 17.3375 |
| Chi | 20,000 to 100,000 | 100,000 and Up | 20,000 to 100,000 & 100,000 and Up | 17.3375 |
| Pi | 20,000 to 100,000 | 50,000 to 100,000 | 20,000 to 100,000 & 50,000 to 100,000 | 2.11 |
- Selva-Salimi1 year agoSolution Sage
so why did you need library table?! all data seems to be in fact table. am I right?!
isn't it your library table?..
Library Library Visits Per Capita Alpha 43.01 Beta 27.11 where the average should be calculated based on these values in this table?
- Anonymous1 year agoNot applicable
I have a facts table and a filters table:
Filters Table--
Library Population Revenue Population and Revenue Beta 100,000 and Up 10,000 and Under 100,000 and Up & 10,000 and Under Sigma 100,000 and Up 100,000 and Up 100,000 and Up & 100,000 and Up Tau 100,000 and Up 100,000 and Up 100,000 and Up & 100,000 and Up Epsilon 100,000 and Up 50,000 to 100,000 100,000 and Up & 50,000 to 100,000 Rho 100,000 and Up 50,000 to 100,000 100,000 and Up & 50,000 to 100,000 Alpha 20,000 and Under 10,000 and Under 20,000 and Under & 10,000 and Under Lambda 20,000 and Under 10,000 and Under 20,000 and Under & 10,000 and Under Mu 20,000 and Under 10,000 and Under 20,000 and Under & 10,000 and Under Upsilon 20,000 and Under 10,000 and Under 20,000 and Under & 10,000 and Under Eta 20,000 and Under 100,000 and Up 20,000 and Under & 100,000 and Up Gamma 20,000 and Under 50,000 to 100,000 20,000 and Under & 50,000 to 100,000 Delta 20,000 and Under 50,000 to 100,000 20,000 and Under & 50,000 to 100,000 Zeta 20,000 and Under 50,000 to 100,000 20,000 and Under & 50,000 to 100,000 Phi 20,000 and Under 50,000 to 100,000 20,000 and Under & 50,000 to 100,000 Psi 20,000 and Under 50,000 to 100,000 20,000 and Under & 50,000 to 100,000 Omega 20,000 and Under 50,000 to 100,000 20,000 and Under & 50,000 to 100,000 Nu 20,000 to 100,000 10,000 and Under 20,000 to 100,000 & 10,000 and Under Theta 20,000 to 100,000 100,000 and Up 20,000 to 100,000 & 100,000 and Up Iota 20,000 to 100,000 100,000 and Up 20,000 to 100,000 & 100,000 and Up Kappa 20,000 to 100,000 100,000 and Up 20,000 to 100,000 & 100,000 and Up Chi 20,000 to 100,000 100,000 and Up 20,000 to 100,000 & 100,000 and Up Pi 20,000 to 100,000 50,000 to 100,000 20,000 to 100,000 & 50,000 to 100,000 Facts Table:
Library Library Visits Per Capita Alpha 43.01 Beta 27.11 Gamma 32.08 Delta 14.13 Epsilon 9.29 Zeta 50.39 Eta 22.42 Theta 12.13 Iota 14.03 Kappa 12.18 Lambda 47.04 Mu 14.4 Nu 39.23 Pi 2.11 Rho 47.27 Sigma 47.3 Tau 32.38 Upsilon 1.16 Phi 16.14 Chi 31.01 Psi 27.11 Omega 17.05 I want to find a formula/calculation that will automatically calculate the Mean Visits Per Capita by Population and Revenue values that I provided above.
- Selva-Salimi1 year agoSolution Sage
Ok, based on your first description the fact table repeated per year so first of all write this and let me know if it works...
Filtered Visits Per Capita = lookupvalue(Facts[library visits per capita],Facts[Library], 'Filters'[Library] , Facts[year] , filters[year]) --add any other column that you think need to make it unique