Forum Discussion

Suman8877's avatar
Suman8877
Advocate II
11 months ago
Solved

Finding Final amount Current Month ?

Hello, everybody 

Is there any dax command where I can see the total amount for the current month?. 

Many thanks,

 

  • Hi Suman8877 

    Yes, you can calculate the total for the current month using a measure like this:

    CurrentMonthAmount =
    CALCULATE(
      SUM('Sales'[Amount]),
       FILTER(
           ALL('Date'),
          MONTH('Date'[Date]) = MONTH(TODAY()) &&
          YEAR('Date'[Date]) = YEAR(TODAY())
       )
    )
    • Replace 'Sales'[Amount] with your column name.
    • This will return the total amount only for the current month based on today’s date.

  • Hi,

    what you have in DAX is a set of funtions to get the end of month in terms of dates

     

    https://dax.guide/eomonth/

     

    https://dax.guide/endofmonth/

     

    The last one can be used in a CALCULATE statement as filter as it returns a table

     

    example

     

    CALCULATE ( [Sales Amount], ENDOFMONTH ( Dates[Date] ) )

     

    If this helped, please consider giving kudos and mark as a solution

    me in replies or I'll lose your thread

    Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

    Consider voting this Power BI idea

    Francesco Bergamaschi

    MBA, M.Eng, M.Econ, Professor of BI

2 Replies

  • Hi Suman8877 

    Yes, you can calculate the total for the current month using a measure like this:

    CurrentMonthAmount =
    CALCULATE(
      SUM('Sales'[Amount]),
       FILTER(
           ALL('Date'),
          MONTH('Date'[Date]) = MONTH(TODAY()) &&
          YEAR('Date'[Date]) = YEAR(TODAY())
       )
    )
    • Replace 'Sales'[Amount] with your column name.
    • This will return the total amount only for the current month based on today’s date.

  • Hi,

    what you have in DAX is a set of funtions to get the end of month in terms of dates

     

    https://dax.guide/eomonth/

     

    https://dax.guide/endofmonth/

     

    The last one can be used in a CALCULATE statement as filter as it returns a table

     

    example

     

    CALCULATE ( [Sales Amount], ENDOFMONTH ( Dates[Date] ) )

     

    If this helped, please consider giving kudos and mark as a solution

    me in replies or I'll lose your thread

    Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

    Consider voting this Power BI idea

    Francesco Bergamaschi

    MBA, M.Eng, M.Econ, Professor of BI