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
When you say "it doesn't show correct value in report" how do you use this measure, against which dimension or what is the context?
- Anonymous5 years agoNot applicable
I'm using the measure as a column in a simple table in report. In report when I select related values from slicers(dim1 and dim2) for a specific order, measure doesn't show the correct value.
- Fowmy5 years agoSuper User
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] )- Anonymous5 years agoNot applicable
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.