Forum Discussion
Help, how d I get % change?
Hi bv27718n,
Looking at your file, you do not need the relationship between the Elite 20 and 21 tables.
Below is a formula that will create a new column in your table with the other tables value
PF Life 2020 col =
VAR _state = 'Elite 5.21'[State]
return
CALCULATE(MAX('Elite 5.20'[PF life]), FILTER('Elite 5.20', 'Elite 5.20'[State] = _state))
you can then create the following measures to get the sums and variance
PF Life 2020 = SUM('Elite 5.21'[PF Life 2020 col])
pf life 2020 var = sum('Elite 5.21'[PF Life]) - sum('Elite 5.21'[PF Life 2020 col])
Result would look like this
I have attached your file with my mods
To slice by Region, you will need to create a region table that contains each state and region then relate the table to the fact tables on the state. You will then use the the region to filter and slice your data.
Please review the following Microsoft docs for best practices for data modelling
https://docs.microsoft.com/en-us/power-bi/guidance/star-schema
I would also suggest that you store your facts in a single fact table with a period column to define the period that the fact belongs to rather than creating tables for each year, it is not a manageble or extensible solution.
Thanks,
Okay, makes sense. I appreciate your help. I did have one last follow up, I am looking at what you did, how do you then add in the other colums likethe PF 2020? I would go into the elite 2020, create columns say for gold patron and patron and then go from there I take it.
Is there an easy way to create a "state region" table? where is that created?
- richbenmintz5 years ago
Resident Rockstar
Hi bv27718n ,
Follow the exact same pattern, create column in the table where the variance is by looking up the value from the corresponding table, then add your measures.
For the State Region Table you could use this csv and import into your model