Forum Discussion

Scott-Munch's avatar
Scott-Munch
New Member
7 years ago
Solved

% cumulative demand calculation no date

Hi,

 

I am new to PBI and need some help trying to calculate a % Cumulative Demand column in PBI.

 

I dont have any dates, essentially I want the calculation to be able to change based on what plant I select in my dataset.

 

I havent seen any formulas that dont take into account date...can anyone help??

 

See the example below

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    Scott-Munch,

    Firstly, create a calculated column in the table using Dax below.

    Index = RANKX(FILTER(Table,Table[Plant#]=EARLIER(Table[Plant#])),Table[Sales (units)],,DESC,Dense)



    Secondly, create the following measures in your table.

    % plant demand = SUM(Table[Sales (units)])/CALCULATE(SUM(Table[Sales (units)]),ALLEXCEPT(Table,Table[Plant#]))
    % Cumulative Demand = CALCULATE([% plant demand],FILTER(ALL(Table),Table[Index]<=MAX(Table[Index])),VALUES(Table[Plant#]))



    Regards,
    Lydia

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Scott-Munch,

    Firstly, create a calculated column in the table using Dax below.

    Index = RANKX(FILTER(Table,Table[Plant#]=EARLIER(Table[Plant#])),Table[Sales (units)],,DESC,Dense)



    Secondly, create the following measures in your table.

    % plant demand = SUM(Table[Sales (units)])/CALCULATE(SUM(Table[Sales (units)]),ALLEXCEPT(Table,Table[Plant#]))
    % Cumulative Demand = CALCULATE([% plant demand],FILTER(ALL(Table),Table[Index]<=MAX(Table[Index])),VALUES(Table[Plant#]))



    Regards,
    Lydia