Forum Discussion
Wresen
Post Patron
2 years agoSUMMARIZE does not use the USERELATIONSHIP
Hi
Thanks for reading this.
I have a USERELATIONSHIP between two tables , the "normal" measure with USERELATIONSHIP work as it should and it looks like this:
CALCULATE(sum(Table[Total]),Table[Month] = "202306" , Table[Salemonth] >= "202306",USERELATIONSHIP(Table[SaleMonth],Monthtable[Year-Month]))
But when i put this in SUMMARIZE it ignores the USERELATIONSHIP.
I wounder if anyone see any completly woring in the measure.
Calc on Item = sumx(ADDCOLUMNS(
SUMMARIZE( Table' ,'Table'[Month] , 'Table'[Item] ),"Calc" ,
CALCULATE(sum(Table[Total]),Table[Month] = "202306" , Table[Salemonth] >= "202306",USERELATIONSHIP(Table[SaleMonth],Monthtable[Year-Month]))
),
[Calc]
)
Thanks so much for any help
Wresen
I modified your measure and now the result should be as expected. However, I am not sure the context for this meaure in your real application, please make necessary changes.Not working Sales Proc Calc = CALCULATE( sumx( ADDCOLUMNS( SUMMARIZE( 'Table' ,'Month'[Year-Month] , 'Table'[Item] ), "Calc" , CALCULATE( sum('Table'[Total]), 'Table'[Month] = "202301" , 'Table'[SalesMonth] >= "202301" ) ), [Calc] ), USERELATIONSHIP('Table'[SalesMonth],'Month'[Year-Month]) )
8 Replies
- Ahmedx
Super User
pls try this
Calc on Item = sumx( ADDCOLUMNS( SUMMARIZE( Table' ,'Table'[Month] , 'Table'[Item] ), "Calc" , CALCULATE(sum(Table[Total]),Table[Month] = "202306" , Table[Salemonth] >= "202306", TREATAS(VALUES(Table[SaleMonth]),VALUES(Monthtable[Year-Month]))) ), [Calc] )if this doesn't help please share the file to help you
- Fowmy
Super User
Wresen
Try below measure:Calc on Item = SUMX ( ADDCOLUMNS ( SUMMARIZE ( 'Table', 'Table'[Month], 'Table'[Item] ), "Calc", CALCULATE ( SUM ( Table[Total] ), Table[Month] = "202306", Monthtable[Year-Month] >= "202306", USERELATIONSHIP ( Table[SaleMonth], Monthtable[Year-Month] ) ) ), [Calc] ) - cinnabanRegular Visitor
I had this exact same problem, and your solution worked perfectly thank you!