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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
atowriss1
Helper I
Helper I

Calcuate next 3 months if an expected date column is 3 months past the selected date slicer

I have a table that has revenue, month-end date and expected revenue date.  I am looking to calculate the total revenue based on Expected revenue date.  So, If my slicer is 12/31/2022, I want expected revenue and store count for 30,60 and 90 days out.

 

My table has an active relationship between ME date and my date calendar, and an inactive relationship between expected revenue date and date calendar.  

 

The file is evergrowing, meaning, I will have a pipeline report that ends on 10/31/2022, 11/30/2022 and 12/31/2022, that is uploaded as 1 table.  

 

Here is what I am using currently: 

Store 60 days = calculate(totalMTD(SUM('EC Pipeline'[EV Rooftops]),'EC Pipeline'[ME Date]),
'EC Pipeline'[Expected Rev Date]=date(2023,2,28)).
 
I tried using the below- but it didn't work (it worked for 30 days, but not 60 or 90
Store 90 days = calculate(totalMTD(SUM('EC Pipeline'[EV Rooftops]),'EC Pipeline'[ME Date]),
USERELATIONSHIP('EC Pipeline'[Expected Rev Date],dimDate[Date]),

DATEADD(dimDate[Date].[Date],+3,MONTH)
)
 
essentially what I want is the MTD total (based on ME Date), IF the expected revenue date is 30,60 and 90 days after the selected date.
2 REPLIES 2
amitchandak
Super User
Super User

@atowriss1 , BAsed on what I got , you can have measure like

 

Rolling 30 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-30,DAY))

 

Rolling 60 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-60,DAY))

 

Rolling 90 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-90,DAY))

 

 

Rolling Days Formula: https://youtu.be/cJVj5nhkKBw

 

You can also consider window function

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

amitchandak
Super User
Super User

@atowriss1 , BAsed on what I got , you can have measure like

 

Rolling 30 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-30,DAY))

 

Rolling 60 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-60,DAY))

 

Rolling 90 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-90,DAY))

 

 

Rolling Days Formula: https://youtu.be/cJVj5nhkKBw

 

You can also consider window function

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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