none
count with summarize dax RRS feed

  • Question

  • Question:
    The TableMain at the bottom returns a table with data correctly.

    VAR TableMain =
        FILTER (
            SUMMARIZE (
                Table1,
                Table1[Field1],
                Table2[Field1],
                Table1[Field2],
                "Count", DISTINCTCOUNT ( Table3[Field2] ),
                "Total Sales", [MyMeasure]
            ),
            [Total Sales] > 10
        )

    Question:
    How do I do a sum (In a separate measure) for the column "Count" in table TableMain ?

    The following count dax does not work:
    CALCULATE(SUM(Mandates[Count]))

    Thank you
    • Edited by arkiboys Wednesday, September 4, 2019 8:59 AM
    Wednesday, September 4, 2019 8:51 AM

Answers

  • Hi

    Can you try with SUMX Expression rather than SUM.


    Thanks Naveen Thummlapenta MCSE

    • Marked as answer by arkiboys Saturday, September 7, 2019 7:14 AM
    Thursday, September 5, 2019 10:43 AM

All replies

  • Hi

    Can you try with SUMX Expression rather than SUM.


    Thanks Naveen Thummlapenta MCSE

    • Marked as answer by arkiboys Saturday, September 7, 2019 7:14 AM
    Thursday, September 5, 2019 10:43 AM
  • Naveen is correct. Just to expand on his answer you would build your measure as follows. 

    VAR TableMain =
        FILTER (
            SUMMARIZE (
                Table1,
                Table1[Field1],
                Table2[Field1],
                Table1[Field2],
                "Count", DISTINCTCOUNT ( Table3[Field2] ),
                "Total Sales", [MyMeasure]
            ),
            [Total Sales] > 10
        )

    RETURN SUMX( TableMain, [Count])


    http://darren.gosbell.com - please mark correct answers

    Thursday, September 5, 2019 10:23 PM
    Moderator