Forum Discussion
pkoetzing
3 years agoAdvocate III
Summarize virtual table
I have a calculated table Combine work per date =
UNION(
SELECTCOLUMNS(
'Work',
"Date', <expression>,
"Minutes", <expression>
),
SELECTCOLUMNS(
'Work',
...
jdbuchanan71
3 years agoSuper User
Bucause SUMX is an iterator function.
When you are writing measure should should always include the table name when referencing a column and never include the table name when referencing a measure. It you measure it looks like [Minutes] is a measure.
Aggregate work per date =
VAR tbl = 'Combine work per date'
RETURN
SUMX ( tbl, [Minutes] )
Also, either of these measure should return the same data as the first one.
Aggregate work per date = SUMX ( 'Combine work per date', 'Combine work per date'[Minutes] )Aggregate work per date = SUM ( 'Combine work per date'[Minutes] )
- pkoetzing3 years agoAdvocate III
You are totally wrong.
- tbl is not a table of the datamodel, but a variable inside a DAX expression
- [minutes] is a valid reference to a column of that variable, and not a measure
- tbl[minutes] or even 'tbl'[minutes] are not a valid DAX expression
- I'm aware that your expressions work fine with tables of the data model, but the question is why they don't work with tables stored in variables (which are actually constants)
- SUMX is an iterator and SUM is an aggregator, but why does SUMX accept the [minutes] column reference, while SUM doesn't?
- I was hoping someone could explain how this relates to the DAX data lineage