Forum Discussion

Chandrashekar's avatar
Chandrashekar
Resolver III
4 years ago
Solved

Help with Measures

Hello Team,   In attached file Sample Report I have two measures. is it possible to combine Measure 2 with Measure 1. Regards, Chandrashekar B  
  • AlexisOlson's avatar
    AlexisOlson
    4 years ago

    Try putting your variables inside the SUMX.

    _countrows = 
    SUMX (
        SUMMARIZE ( Table3, Table3[Name], Table3[Location] ),
        VAR _tbl =
            CROSSJOIN (
                SELECTCOLUMNS ( { Table3[Name] }, "name", [Value] ),
                SELECTCOLUMNS ( { Table3[Location] }, "location", [Value] )
            )
        RETURN
            CALCULATE (
                COUNTROWS ( FILTER ( Table1, Table1[Priority] = 1 ) ),
                TREATAS ( _tbl, Table1[Name], Table1[Location] )
            )
    )