Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 Month | Account Id | Account Name | Revenue |
| 01/12/2020 | 2 | 2 ltd | 10 |
| 01/01/2021 | 1 | 1 ltd | 10 |
| 01/02/2021 | 1 | 1 ltd | 10 |
| 01/03/2021 | 1 | 1 ltd | 10 |
Table 2: contain date client terminated
|
Table 3: Desired Results
|
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
|
I have also a calendar table linked to Report MOnth and Notice date
Thanks in advance
Solved! Go to Solution.
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.
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.
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.
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |