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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

SUMIF with Date Hierarchy Errors

I have a sumif measure that correctly counts my IF statement in Month Year format, but I would like to view it by year or by quarter. Currently, when I change hiearchy views it counts less then it would in the "Month Year format." The total will still be correct however. 

 

The measure I used to SUM the results of the IF statement is

SUM = SUMX(CALCULATETABLE(VALUES(Customers[Customer ID], ALL(DATE[Month Year], 

DATE[YEAR_MONTH_NUM]), DATE[Year Month Order]), [IF statement Measure]

 

The IF statement is a period over period calculation rewarding a 1 or 0 based on the two months. 

3 REPLIES 3
Anonymous
Not applicable

Cumulative Total Revenue would look like for $10 in revenue per month ending in March.

Jan    10    

Feb    20

March  30

April 30

 

Reverse Total Revenue

Jan 30

Feb 20

March 10

April 0

 

 

Anonymous
Not applicable

I use these measures for period over period calculations found on another thread to calculate new and lost customers. 

 
New Customers This Period = SUMX(VALUES(CUSTOMERS[ID]),if(ISBLANK([Cumulative TotalPreviousMonth]) && not(ISBLANK([Cumulative Total])) , 1,BLANK()))
 
Lost Customers This Period = SUMX(VALUES(CUSTOMERS[ID]),if(ISBLANK([Reverse Total]) && not(ISBLANK([Reverse Total Previous Month])) , 1,BLANK()))
 
The calculation works for New Customers, but when calculating lost customers it seems to be excluding Janurary for the most part. Any idea how to fix? 
 
The measure for reverse total is
Reverse Total  =
CALCULATE (
    SUM ( 'Sales'[Revenue] ),
    FILTER (
        ALL ( 'DATE'[DATE] ),
        'DATE'[DATE] >= MIN( ( 'DATE'[DATE] )
    )
))
amitchandak
Super User
Super User

@Anonymous ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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