Forum Discussion

uaTaG87's avatar
uaTaG87
New Member
3 years ago

CALCULATE(VALUES(*column name*))

Hi everyone,

I am not very expert in DAX language, but I can program. However, I don't find really straight forward some mechanics of the language.
I am struggling to try to understand what this command does. I am working on a decently big project and part of the code was previously made by an expert. I have a measure in this project that needs to calculate some costs. However, my issue is understanding what the command "CALCULATE(VALUES(*Table name[column name]*) returns.

In particular, it is inside a SUMX and the code is this:

SUMX(
*Table name 1*,
[*a measure that returns an integer*]*
CALCULATE( VALUES (*Table name[column name]*))
)

Thank you very much for answering.

1 Reply

  • hi uaTaG87 

    A one row one column table can be used as single value in DAX. So your code makes sense only when VALUES() returns a single value, as CALCULATE expects a expression returning a single value. Otherwise, it prompts error.