Forum Discussion
Anonymous
4 years agoNot applicable
Implement Aggregate Sum column based on values from other columns
Hello All I wish to implement a column D as shown in below screenshot using DAX measure such that Column D aggregation is sum of values in Column C. For Example, Value in Row number D3 is sum of valu...
- 4 years ago
Hi,
I assume you want to create a new calculated column.
Please check the below picture and the attached pbix file.
Total Supplier Spend CC = VAR _currentsupplier = Data[Supplier] VAR _suppliertable = FILTER ( Data, Data[Supplier] = _currentsupplier ) VAR _maxsupplierspend = MAXX ( _suppliertable, Data[SupplierSpend] ) VAR _condition = Data[SupplierSpend] = _maxsupplierspend RETURN SUMX ( _suppliertable, Data[SupplierSpend] ) * DIVIDE ( _condition, _condition ) - Anonymous4 years ago
Anonymous
Please see the solution using a 'Measure':
Dax Code:
sumn =VAR maxval =MAXX (FILTER ( ALL ( Data ), Data[Supplier] = SELECTEDVALUE ( Data[Supplier] ) ),Data[SupplierSpend])VAR summ =CALCULATE (SUMX (FILTER ( ALL ( Data ), Data[Supplier] = SELECTEDVALUE ( Data[Supplier] ) ),Data[SupplierSpend]))VAR conditions =SELECTEDVALUE ( Data[SupplierSpend] ) = maxvalRETURNIF ( summ * conditions > 0, summ * conditions, BLANK () )Also, you need to enable 'Show Items with No Data' for supplier as I have shown in following image:Also enable 'Don't Summarize' for all fields.Please accept it as a solution if it matches your requirement🙂
Jihwan_Kim
Super User
4 years agoHi,
I assume you want to create a new calculated column.
Please check the below picture and the attached pbix file.
Total Supplier Spend CC =
VAR _currentsupplier = Data[Supplier]
VAR _suppliertable =
FILTER ( Data, Data[Supplier] = _currentsupplier )
VAR _maxsupplierspend =
MAXX ( _suppliertable, Data[SupplierSpend] )
VAR _condition = Data[SupplierSpend] = _maxsupplierspend
RETURN
SUMX ( _suppliertable, Data[SupplierSpend] ) * DIVIDE ( _condition, _condition )
Anonymous
4 years agoNot applicable
Jihwan_Kim Thanks for the solution but can I also get this as a DAX measure.