Forum Discussion

jav226's avatar
jav226
Frequent Visitor
7 years ago
Solved

Computing rollup weighted sum

Seeking assistance from Power BI experts.

 

I'm trying to compute the overall progress of Program 1, which is sum of each individual Project Progress, based on the weightage assigned for each Project.

 

Below is the illustration.  Appreciate if someone can share the expression to achieve this computation. Thanks in advanced.

 

ProgramProjectWeightageProgressProject Weighted Progress
(Weightage x Progress)
Program 1Project A8.80%4.80%0.42%
Program 1Project B28.20%1.32%0.37%
Program 1Project C52.00%0.06%0.03%
Program 1Project D11.00%1.00%0.11%
Overall Program 1 Progress   0.94%

 

  • So based on your new requirement to apply the weightings differently at different levels you might be able to do something like the following which just dynamically changes the factor inside the SUMX based on which columns are filtered

     

    SUMX( table1, IF(ISFILTERED( table1[Project]), 1,  -- at the project level multiply by 1
        IF( ISFILTERED(Program], [Project Weightage],  -- at the program level apply the project weight
        [Program Weightage] * [Project Weightage])   -- at the total level apply program and project weighting
    * [Progress])

12 Replies

  • you should be able to do this with a measure like the following:

    SUMX(  <table name>, [Weightage] * [Progress])

    • jav226's avatar
      jav226
      Frequent Visitor

      Thanks Gosbell for the quick response.

       

      However, SUMX doesn't seem to resolve the problem. 

       

      Mainly is because each level (Overall > Program > Project) has its own weightage. 

       

      ProgramProjectWeightageProgressProject Weighted Progress (Weightage x Progress)
      Program 1Project A8.80%4.80%0.42%
      Program 1Project B28.20%1.32%0.37%
      Program 1Project C52.00%0.06%0.03%
      Program 1Project D11.00%1.00%0.11%
      Overall Program 1 Progress   0.94%

       

      ProgramProjectWeightageProgressProject Weighted Progress (Weightage x Progress)
      Program 2Project E20.00%2.00%0.400%
      Program 2Project F20.00%1.00%0.200%
      Program 2Project G30.00%3.00%0.900%
      Program 2Project H30.00%3.00%0.900%
      Overall Program 2 Progress   2.40%

       

      ProgramProgram WeightageProgram Weighted Progress (Overall Program Progress x Program Weightage)
      Program 1 Progress30%0.28%
      Program 2 Progress70%1.68%
      All Programs Progress 1.96%

       

      This is how my fact table looks like:-

      ProgramProgram Weightage (%)ProjectProject Weightage (%)Project Progress (%)
      Program 130%Project A8.80%4.80%
      Program 130%Project B28.20%1.32%
      Program 130%Project C52.00%0.06%
      Program 130%Project D11.00%1.00%
      Program 270%Project E20.00%2.00%
      Program 270%Project F20.00%1.00%
      Program 270%Project G30.00%3.00%
      Program 270%Project H30.00%3.00%
      • d_gosbell's avatar
        d_gosbell
        Super User

        However, SUMX doesn't seem to resolve the problem. 

         

        Mainly is because each level (Overall > Program > Project) has its own weightage. 


        So this is additional information. We can really only answer based on the information you provided.

         

        But doesn't the same approach still work? Isn't the program just an additional weighting that you need to apply?

         

        eg.

        SUMX(  <table name>, [Program Weightage] * [Project Weightage] * [Progress])