Forum Discussion
dax help
Anonymous
What is the error and how is the measure [all units usa] constructed?
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
Click on the Thumbs-Up icon on the right if you like this reply 🙂
hist units usa:=TRUNC(SUMX(product, product[historical_qty_usa])/[num distinct periods],2)
[all units usa] = CALCULATE([hist units usa],FILTER(all('date'[date_key]), 'date'[date_key]=max('date'[date_key])))
Now i want to create a measure like
[usa sku count] = calculate(count(product[sku]), [all units usa] >1)
error msg -
A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
hope i am able to clear you the requirement.
- Anonymous6 years agoNot applicable
Hi Anonymous
You can't use a measure inside a boolean expression that is used as filter expression. There are certain rules related to this
Refer to this: https://docs.microsoft.com/en-us/dax/calculate-function-dax
Apart from this your measure [usa sku count] = calculate(count(product[sku]), [all units usa] >1) doesn't refer any column which needs to be filtered.
- Anonymous6 years agoNot applicable
hi, i understand those rules about calculate function..but i am looking for a help or work around.
- Anonymous6 years agoNot applicable
Hi Anonymous can you share some sample data along with expected output and a clear description of the problem. Maybe then I can help you.
Thanks
- Anonymous6 years agoNot applicable
Hi Anonymous ,
Share sample data if you can.
else try
[usa sku count] = VAR _allunitsusa = [all units usa] RETURN COUNTX ( FILTER ( 'Product', _allunitsusa > 1 ), Product[Sku] )Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)