Forum Discussion
Sum up values in column
- Anonymous5 years ago
Thanks v-xulin-mstf for your reply. The issue is resolved by changing the tabular model and measure.
Anonymous
The measure you created is supposed to summarize the FACT 2 table by orderkey and get the maximum value for each orderkey and sum them right? So, you are slicing by the given dimension and you do not want to calculate anything from FAC 1.
Can you try this version?
Length =
SUMX (
ADDCOLUMNS (
SUMMARIZE ( 'Fact2', 'Fact2'[OrderKey] ),
"sum of length", CALCULATE ( MAX ( 'Fact2'[length] ) )
),
[sum of length]
)
I tested the code but it seems that it doesn't work when I select values from slicer. I changed the measure to :
Length :=
calculate(
SUMX (
ADDCOLUMNS (
SUMMARIZE ( 'Fact2', 'Fact2'[OrderKey] ),
"sum of length", CALCULATE ( MAX ( 'Fact2'[length] ) )
),
[sum of length]
)
, FILTER (
'Fact2',
'Fact2'[OrderKey] IN VALUES ( 'Fact1'[OrderKey])
)
)
But it doesn't show the correct value. It sums up all orderkeys without any concern to selection in slicer.
- Fowmy5 years agoSuper User
Anonymous
I am not sure how your model and the relationships are defined, you may share a sample PBIX file to check what sort of issues you are facing.
Also, explain the out put you are trying to achieve.