Forum Discussion

Wresen's avatar
Wresen
Post Patron
2 years ago
Solved

SUMMARIZE 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[Mont...
  • Fowmy's avatar
    Fowmy
    2 years ago

    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])
    )