Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
maxse
New Member

DAX Command for SUMIF Type Format

I'm trying to create a DAX formula that will return the SUM of 'Invoice_Amount' for any date in the current month. Then another formula for the SUM of 'Invoice_Amount' for any date in the prior calendar month. Any help would be appreciated.

 

LastMonthBilled = SUMX(FILTER(CWInvoices,CWInvoices[Date_Invoice]>=TODAY()-30), CWInvoices-CWInvoices[Invoice_Amount])
1 REPLY 1
FreemanZ
Super User
Super User

hi @maxse 

try like:

AmtCurrentMonth = 
CALCULATE(
    SUM(TableName[Invoice_Amount]),
    MONTH(TableName[Date]) = MONTH(TODAY()) 
        &&YEAR(TableName[Date]) = YEAR(TODAY()) 
)
 
AmtLastMonth = 
CALCULATE(
    SUM(TableName[Invoice_Amount]),
    MONTH(TableName[Date]) = MONTH(EDATE(TODAY(), -1)) 
        &&YEAR(TableName[Date]) = YEAR(EDATE(TODAY(), -1)
)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.