Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have data on municipality expenditures by year. There are also variables for the class of expenditure e.g. library services, and the account this expenditure is on. Example:
Municipality | Expenditure | Account | Account index | Class | Year |
Municipality 1 | 1000€ | Total costs | 1 | Library services | 2021 |
Municipality 1 | 100€ | Staff costs | 2 | Library services | 2021 |
Municipality 1 | 100€ | Grants | 3 | Library services | 2021 |
Municipality 2 | 3000€ | Total costs | 1 | Administration | 2021 |
There are only three possible accounts per each municipality/year/class. The problem is, the "total costs" sum includes the other account costs, and the row sum per class or per municipality will sum up to more than what are the true total costs. So what I want to do is to create a new column with new accounts: staff costs, grants, and "other costs", where staff costs and grants are subtracted from the total costs in order to obtain "other costs". My strongest idea is to index the rows by municipality/class/year, and create "other costs" column which references the sorted Account -row and subtracts 2 and 3 from 1 and places this on the index 1 row. On the index 2 row, i want to place the unchanged staff costs etc, so that the row sum will then reflect the total cost. There are plenty of instructions on how to create differences between consecutive rows, but not on more complex calculations. I am stuck on this since I am new to powerBI.
Any help is greatly appreciated, thanks.
Solved! Go to Solution.
Hi @Anonymous
i am not sure if i understand your requirement complete, please try to create a table with this:
Hi @Anonymous
i am not sure if i understand your requirement complete, please try to create a table with this:
Hi @FreemanZ, Your table seems to do exactly what I want. I also managed to solve this by creating a new column and using switch and several filters. Thanks for the help anyway!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
46 | |
28 | |
22 | |
12 | |
8 |
User | Count |
---|---|
75 | |
52 | |
46 | |
15 | |
12 |