Forum Discussion
rolf1994
Helper II
9 years agoCalculated total showing the wrong number in directquery
Hi, I am trying to calculate the following: Measure DistinctQuantity = CALCULATE(DISTINCTcount([Id]),[IsActive]="Active") Measure TotalPrice= DistinctQuantity*sum(Price) My data looks like th...
- 9 years ago
In this scenario, you TotalPrice should be eavaluated on each row level, so you should use SUMX() function.
Total Price = SUMX(Table3,Table3[Price]*[Total Quantity])
Regards,
Greg_Deckler
Community Champion
9 years agoIn general, consider that the total line is really the measure evaluated in the context of ALL. You can add a if HASONEFILTER to your measure to calculate it for rows with the alternative being your calculation for your total row. I may have those reversed. It's early.