Forum Discussion
Fali324
2 years agoHelper II
creating a calculated column based on another column
Hi,
I am trying to create a calculated column to sum another column. Here is some example data of what I am trying to produce:
| Project Name | Product | Cost | Total Project Cost | Percentage |
| Project A | car | £1,000.00 | £7,000.00 | 14% |
| Project A | bus | £1,000.00 | £7,000.00 | 14% |
| Project A | hat | £1,000.00 | £7,000.00 | 14% |
| Project A | glass | £1,000.00 | £7,000.00 | 14% |
| Project A | cup | £1,000.00 | £7,000.00 | 14% |
| Project A | car | £1,000.00 | £7,000.00 | 14% |
| Project A | bus | £1,000.00 | £7,000.00 | 14% |
| Project B | hat | £2,000.00 | £8,000.00 | 25% |
| Project B | car | £2,000.00 | £8,000.00 | 25% |
| Project B | bus | £2,000.00 | £8,000.00 | 25% |
| Project B | hat | £2,000.00 | £8,000.00 | 25% |
I had the data in red text, I am trying to calculate total project cost so I can then work out the percentage. what is the best way to do this. Any help is much appreciated.
Hi Fali324
For total project you can use dax :
Total_project_Rita = CALCULATE(sum('Table'[Cost]),ALLEXCEPT('Table','Table'[Project Name]))for percent%_Rita = [Cost]/[Total_project_Rita]PBIX is attachedIf this post helps, then please consider Accepting it as the solution to help the other
members find it more quickly
1 Reply
- Ritaf1983Super User
Hi Fali324
For total project you can use dax :
Total_project_Rita = CALCULATE(sum('Table'[Cost]),ALLEXCEPT('Table','Table'[Project Name]))for percent%_Rita = [Cost]/[Total_project_Rita]PBIX is attachedIf this post helps, then please consider Accepting it as the solution to help the other
members find it more quickly