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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
fazza1991
Helper II
Helper II

Sum not adding up correctly

Hi,

I am trying to correct the formula below

 

 

 

 

Measure 3 = 

CALCULATE([Measure 4],  
   DATESINPERIOD ( 
        'Date'[Date],                 
        EOMONTH ( MAX ( 'Terminated|SF'[Notice_Date] ), 0 ), 
        -12,  MONTH))

 

 

 

 

I am trying to get the last 12 months revenue from date of termination but the information is stored on different tables.

 

 Table 1: contain revenue per month

Report MonthAccount IdAccount NameRevenue
01/12/202022 ltd10
01/01/202111 ltd10
01/02/202111 ltd10
01/03/202111 ltd10

 

 

 

 

 


Table 2: contain date client terminated

Notice dateAccount IdAccount NameReason Left
01/03/202111 ltdCompetitor

 

 

 

Table 3: Desired Results

Account NameLast 12 months RevenueReason left
1 ltd30Competitor

 

The above formula allows me to calculate the last 12 months revenue, when slicer is used to show the month reporting on it displays the correct client and revenue but the total includes all clients that may have terminated and the prior 12 months

revenue eg.

 

 

 

Table 4: unwanted results

Account NameLast 12 months revenueReason Left
1 ltd30competitor
Total40 

 

 

 

 

I have also a calendar table linked to Report MOnth and Notice date

 

Thanks in advance

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @fazza1991 ,

 

According to your description, here are my steps you can follow as a solution.

(1)My test data is the same as yours.

(2) We can create  a measure.

Last 12 months Revenue = 
CALCULATE (
    SUM ( 'Table 1'[Revenue] ),
    FILTER (
        'Table 1',
        [Report Month] >= EOMONTH ( MAX ( 'Table 2'[Notice date] ), -12 )
            && [Report Month] <= MAX ( 'Table 2'[Notice date] )
    )
)

(3)Then the result is as follows.

vtangjiemsft_0-1667209745771.png

 

Best Regards,

Neeko Tang

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @fazza1991 ,

 

According to your description, here are my steps you can follow as a solution.

(1)My test data is the same as yours.

(2) We can create  a measure.

Last 12 months Revenue = 
CALCULATE (
    SUM ( 'Table 1'[Revenue] ),
    FILTER (
        'Table 1',
        [Report Month] >= EOMONTH ( MAX ( 'Table 2'[Notice date] ), -12 )
            && [Report Month] <= MAX ( 'Table 2'[Notice date] )
    )
)

(3)Then the result is as follows.

vtangjiemsft_0-1667209745771.png

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.