Forum Discussion

omelo's avatar
omelo
Helper III
4 years ago
Solved

DAX sum amount

Hi All, I need help with a sum, I have no idea what function or expression will give me the expected results. The data structure is like this:   I need to show the sum of Amount by create_d...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi omelo ,

    Here are the steps you can follow:

    1. Create calculated column.

    Month = MONTH('Table'[Create_date])
    Count = COUNTX(FILTER(ALL('Table'),'Table'[Project]=EARLIER('Table'[Project])),[Project])
    Flag =
    IF(
        [Count]>1 && ISBLANK('Table'[Phase]),0,1)

    2. Create measure.

    Measure =
    CALCULATE(
        SUM('Table'[Amount]),
        FILTER(ALL('Table'),'Table'[Month]=MAX('Table'[Month])&&'Table'[Flag]=1))

    3. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly