Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Calculate Amount For Each Month

Hello Community ,          I   have a table of  Invoice transaction  . I want to calculate the amount of transaction By MonthYear for each Client    Source Data :         Client|Amount|Date     ...
  • v-janeyg-msft's avatar
    5 years ago

    Hi, Anonymous 

     

    According to your description ,I think you can create a yearmonth column and a measure,then use it in table.

    Like this:

    YM = DATE(YEAR('Table'[Date]),MONTH('Table'[Date]),1)
    Measure = 
    SUMX (
        SUMMARIZE (
            'Table',
            [Client],
            [YM],
            "a",
                SUMX (
                    FILTER (
                        ALL ( 'Table' ),
                        [Client] = SELECTEDVALUE ( 'Table'[Client] )
                            && [YM] = SELECTEDVALUE ( 'Table'[YM] )
                    ),
                    [Amount]
                )
        ),
        [a]
    )

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

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