Forum Discussion
Measure not summing correctly for Total Row
Hi All,
This is driving me crazy. I reffered to this post by Greg_Deckler. Created YTD measure for Project Profit column present in Loss Factor table. Created 2 separate measures Profit and Loss with below calculation:
6 Replies
- amitchandak
Super User
Please try
Profit = CALCULATE(sum([Project Profit]) ,[Project Profit] > 0) Loss = CALCULATE(sum([Project Profit]) ,[Project Profit] < 0) OR Profit = CALCULATE(([Project Profit]) ,[Project Profit] > 0) Loss = CALCULATE(([Project Profit]) ,[Project Profit] < 0)
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.- AnonymousNot applicable
Hi amitchandak sorry but you cannot use true/false condition inside calculate. Also we can not sum measure explicitly. The below dax by TomMartens was quite close but still not giving the expected result.
MeasureProfitFinal = CALCULATE( SUMX( ADDCOLUMNS( SUMMARIZE('AllData' ,'AllData'[Client] ,'AllData'[Date].[Month] ,'AllData'[Retainer] ) ,"This",[MeasureProfit]) ,[This]) )Please help me as this is bit urgent and not able to proceed further. When i export the data to the excel i get the correct result but not in Total row in table visual.
- amitchandak
Super User
Ok, profit is a calculated measure
try this, something like
Sales GT 0 = CALCULATE(sum(Sales[Sales Amount]),filter(sales,Sales[Current Sales]>0)) or Sales GT 0 = CALCULATE((Sales[Sales Amount]),filter(sales,Sales[Current Sales]>0))