cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RC0619
Frequent Visitor

INTERSECT in time series

Hi,

I am using INTERSECT function to capture the volume of different categories being added in different months. However, I am struggling to get rid of the very first column which is the earliest date. Any advice, please?

My measure is as follows: 


addition =

VAR TM = VALUES('Table'[Category])
VAR LM = CALCULATETABLE(VALUES('Table'[Category]),DATEADD('Table'[Date],-1,MONTH))

RETURN SUMX(EXCEPT(TM,LM),SUM('Table'[Volume]))

intersect.PNG

My raw data:

DateCategoryVolume
2021-01-01A2
2021-02-01A4
2021-03-01A5
2021-04-01A1
2021-01-01B3
2021-02-01B2
2021-03-01B5
2021-03-01C2


 
 
1 ACCEPTED SOLUTION
lbendlin
Super User III
Super User III

addition = 
VAR TM = VALUES('Table'[Category])
VAR LM = CALCULATETABLE(VALUES('Table'[Category]),DATEADD('Table'[Date],-1,MONTH))
VAR md = CALCULATE(min('Table'[Date]),aLL('Table'))
RETURN if (md=max('Table'[Date]),BLANK(),SUMX(EXCEPT(TM,LM),SUM('Table'[Volume])))

View solution in original post

1 REPLY 1
lbendlin
Super User III
Super User III

addition = 
VAR TM = VALUES('Table'[Category])
VAR LM = CALCULATETABLE(VALUES('Table'[Category]),DATEADD('Table'[Date],-1,MONTH))
VAR md = CALCULATE(min('Table'[Date]),aLL('Table'))
RETURN if (md=max('Table'[Date]),BLANK(),SUMX(EXCEPT(TM,LM),SUM('Table'[Volume])))

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.