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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Can I use earlier statement twice ?? eariler -> give me a first table and then eariler again

Query1_VW[Last Occurance] =
DATEDIFF(CALCULATE(MAX(Query1_VW[Week_Begin].[Date]), FILTER(Query1_VW,Query1_VW[combine Game and Card ID] = EARLIER(Query1_VW[combine Game and Card ID])&&Query1_VW[Week_Begin]<EARLIER(Query1_VW[Week_Begin]))) , Query1_VW[Week_Begin],WEEK)
 
This is the first eailer statement to create a new column.
 
=CALCULATE(
DATEDIFF(
CALCULATE(MAX(Query1_VW[Week_Begin].[Date]),
FILTER(Query1_VW,Query1_VW[combine Game and Card ID] = EARLIER(Query1_VW[combine Game and Card ID])&&Query1_VW[Week_Begin]<EARLIER(Query1_VW[Week_Begin])
)
) ,
Query1_VW[Week_Begin],WEEK) , FILTER(Query1_VW, Query1_VW[Last Occurance] = 1
)
This is the scecond eariler statement I want to use run the eariler again, but it doesn't work gives me error says [week_Begin] is a column not a measure!
 
 
So, basic idea behind it. I want to use eariler statement to create first table, filter it based on my earlier statment column.
then, I want to use the eariler statement on the filtered data.
 
2 REPLIES 2
Anonymous
Not applicable

Hi

Did you try to use a variable on your formula?

var _earlierWeek = Query1_VW[Week_Begin]

 

If I answer your question, please mark my post as a solution, this will also help others.
Please give Kudos for support

.Tomas Santandreu Polanco |Principal Business Intelligence Consultant
www.designmind.com

kentyler
Solution Sage
Solution Sage

EARLIER gives you access to the previous filter context. If you call it in a CALCULATE statement it will give you access to the filter context before the calculate statement is executed. You would be able to nest the calls....but EARLIER is not designed to give you access to the previous row.





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors