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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Forecast next half-year sales

Hello all you brilliant minds,

 

I have a table of opportunities, similar to the below:

 

OpportunityClose DateAmount
A4/1/2023        100,000
B5/1/2023        150,000
C6/1/2023          75,000
D7/1/2023        250,000
E8/1/2023        400,000
F9/1/2023          50,000
G10/1/2023        300,000
H11/1/2023        500,000
I12/1/2023        250,000
J1/1/2024        100,000
K2/1/2024        550,000
L3/1/2024        400,000
M4/1/2024          75,000
N5/1/2024          25,000
O6/1/2024        600,000
P7/1/2024        225,000
Q8/1/2024        300,000
R9/1/2024        250,000
S10/1/2024        450,000
T11/1/2024        100,000
U12/1/2024          75,000
V1/1/2025        325,000
W2/1/2025        375,000
X3/1/2025        225,000
Y4/1/2025        400,000
Z5/1/2025        550,000

 

I also have a date table.

 

I am trying to create a chart showing the next half-year's total opportunity amount (based on close date).  I'm struggling with how to make this dynamic so that when the current date moves from one half-year to the next, the calculated period moves correspondingly.

 

My last attempt looked like this:

 

NextH =
VAR CurYear = YEAR(TODAY())
VAR NextYr = CurYear+1
VAR CurMonth = MONTH(TODAY())
VAR Result = CALCULATE(SUM(Opportunity[Amount]))
RETURN
IF(CurMonth<=6, CALCULATE(Result, FILTER(Opportunity, Opportunity[CloseYear]=CurYear), FILTER(Opportunity, Opportunity[CloseMonth]>=7)), IF(CurMonth>=7, CALCULATE(Result, FILTER(Opportunity, Opportunity[CloseYear]=NextYr), FILTER(Opportunity, Opportunity[CloseMonth]<=6))))
 
I appreciate any suggestions you might have.
 
Thanks!
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@StaceyLGriffeth , refer if this can help

 

Half Year Time Intelligence, Half Year Till date: https://youtu.be/fkm3Xvjcpl0

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@StaceyLGriffeth , refer if this can help

 

Half Year Time Intelligence, Half Year Till date: https://youtu.be/fkm3Xvjcpl0

@amitchandak thank you!  I don't fully understand the DAX, but it solved my problem.  Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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