Forum Discussion
Each Customer Total Rollup
- 5 years ago
- 5 years ago
Hi sneevand ,
You can use the following measure for instead:
Measure = SUMX ( SUMMARIZE ( 'Table', 'Table'[CustomerNo], 'Table'[YearValue], "Total Qty", IF ( CALCULATE ( SUM ( 'Table'[Qty] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[CustomerNo] ), 'Table'[YearValue] = MAX ( 'Table'[YearValue] ) - 1 ) ) = 0, 0, CALCULATE ( SUM ( 'Table'[Qty] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[CustomerNo] ), 'Table'[YearValue] = MAX ( 'Table'[YearValue] ) ) ) ) ), [Total Qty] )If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi sneevand ,
You can use the following measure:
Measure =
IF (
CALCULATE (
SUM ( 'Table'[Qty] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[CustomerNo] ),
'Table'[YearValue]
= MAX ( 'Table'[YearValue] ) - 1
)
) = 0,
0,
CALCULATE (
SUM ( 'Table'[Qty] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[CustomerNo] ),
'Table'[YearValue] = MAX ( 'Table'[YearValue] )
)
)
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
- sneevand5 years agoFrequent Visitor
Check the total instead of 17 it shows as 37 ; and it does not work simirally if i join with date dimension; my date dimension dates from min and max date of the customer table.
i updated the code to use dates from date dimension,
filter(ALLEXCEPT(Dates,Dates[Date]),Dates[MonthValue]=validmonth && Dates[YearValue]=validyear)and did sumx(values(customertable),measure) , but total wont match.
- v-deddai1-msft5 years agoCommunity Support
Hi sneevand ,
You can use the following measure for instead:
Measure = SUMX ( SUMMARIZE ( 'Table', 'Table'[CustomerNo], 'Table'[YearValue], "Total Qty", IF ( CALCULATE ( SUM ( 'Table'[Qty] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[CustomerNo] ), 'Table'[YearValue] = MAX ( 'Table'[YearValue] ) - 1 ) ) = 0, 0, CALCULATE ( SUM ( 'Table'[Qty] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[CustomerNo] ), 'Table'[YearValue] = MAX ( 'Table'[YearValue] ) ) ) ) ), [Total Qty] )If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai