Forum Discussion

AltGr9's avatar
AltGr9
Icon for Helper I rankHelper I
4 years ago
Solved

Applying MAX to Summerize

Hello all, I have a summerize statement that returns a count of rows by date, and I'm trying to find the max date with a count greater than 10.    Here is what I have so far, but it doesn't want to ...
  • Jihwan_Kim's avatar
    4 years ago

    Hi,

    Please check the below picture.

    One thing that I want to share is, try to use addcolumns & summarize functions together, instead of using only summarize when adding expressions to the virtual summarized table.

    The reason is that, not very often happen in general cases, but in some cases (in fact, quite a lot...), if authors use only summarize function and add expressions into the virtual summarized table, there might be an issue in creating correct numbers and having a good performance.

     

     

    Max Date With Count Greater Than 10 =
    VAR _s =
    FILTER (
    ADDCOLUMNS (
    SUMMARIZE ( 'Fact Table', 'Fact Table'[Date] ),
    "Count", CALCULATE ( COUNT ( 'Fact Table'[Date] ) )
    ),
    [Count] > 10
    )
    RETURN
    MAXX ( _s, 'Fact Table'[Date] )