I have created a pareto analysis but the problem is that it's not dynamic because the rankx it's done in a calculated column in customers table in order of the sum of sales in an other table.
Now my #runningtotal is
CALCULATE([M-CY_Sales];FILTER(ALLSELECTED(CUSTOMERS);
CUSTOMERS[DAX RANK]<=MAX(CUSTOMERS[DAX RANK]));CUSTOMERS[Customer Number] <>BLANK();
'Detail Sales Report'[Total Actual Revenue - Base]>0)
where I use the calculated column with rankx CUSTOMERS[DAX RANK]. Can I make this measure dynamic? I was thinking to build a table with var and addcoloumn but I'm not able to do it. My actual problem is that I need this pareto dynamic because the filter for district does not function with static column.
I was trying to write something but I don't know how I could create what I want
#RUNNINGTOTAL2 =
var customerranked=ADDCOLUMNS(ALLSELECTED(CUSTOMERS);"ranking";[M-DAX RANK])
return
CALCULATE([M-CY_Sales];FILTER(ALLSELECTED(CUSTOMERS);
customerranked<=MAX(customerranked));CUSTOMERS[Customer Number]<>BLANK();
'Detail Sales Report'[Total Actual Revenue - Base]>0)
Obviously this is not correct. I hope you understand my problem. I need to refer a virtual column done with rankx in my measure running total
Sample data edited with measures: [here]: https://mega.nz/#!4t1y0AJI!XF2Vcejm6C50nnssQCS1bJEhnqIGiH1d-mIltVskRgE