Forum Discussion
Scott-Munch
7 years agoNew Member
% 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
- Anonymous7 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
- AnonymousNot 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