Forum Discussion

Fali324's avatar
Fali324
Helper II
2 years ago
Solved

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 NameProductCostTotal Project CostPercentage
Project Acar£1,000.00£7,000.0014%
Project Abus£1,000.00£7,000.0014%
Project Ahat£1,000.00£7,000.0014%
Project Aglass£1,000.00£7,000.0014%
Project Acup£1,000.00£7,000.0014%
Project Acar£1,000.00£7,000.0014%
Project Abus£1,000.00£7,000.0014%
Project Bhat£2,000.00£8,000.0025%
Project Bcar£2,000.00£8,000.0025%
Project Bbus£2,000.00£8,000.0025%
Project Bhat£2,000.00£8,000.0025%

 

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 attached

    If this post helps, then please consider Accepting it as the solution to help the other

    members find it more quickly

1 Reply

  • 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 attached

    If this post helps, then please consider Accepting it as the solution to help the other

    members find it more quickly