Forum Discussion

ciken's avatar
ciken
Resolver I
2 years ago

Using SELECTEDVALUE but getting no grand total

Good morning! I've got a table where I am trying to find the total purchase value of an account only after the activation of a new product. I started by adding a calculated column to the table but I would like the ability to look at it with a page filter where it stops on a specific date and it seems like with the calculated column, I can't do that. 

 

So, I created a measure and I have put multiple VAR statements into the measure to get the selected values but when I input them into the measure I get accurate information in the row but no Grand Total unless I filter my data to a specific account (which is also not the correct total). Here is the statement and a few screen shots to show you what my results are...

 

Product Purchased (TEST) =
VAR ParentID = SELECTEDVALUE(Equipment_in_Practice[ParentID])
VAR InstallDate = SELECTEDVALUE(Equipment_in_Practice[Installation Date])-15
VAR ProductPurchased = SUMX(FILTER('Order Product', 'Order Product'[ParentID]=ParentID&&'Order Product'[Ship Date]>=InstallDate),CALCULATE([Total Price],'Order'[Status]<>"VOIDED"))

RETURN
ProductPurchased
 
Full account list with no grand total 

 

Filtered list with incorrect grand total (Correct value from calculated column in blue / Incorrect value in Yellow)

 

 Help?

7 Replies