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

Creating a function that updates itself based on the most recent date.

I am trying to create a function or measure from my data that will automatically change itself to the newest date. For example, if "12001" is week number 1 (also the most recent in this scenario) and the data updates every week, I want a function that will update it to where it is taking into account the latest data into account. So when I update my data to include next week "12002" then the function will automatically take from week 2's data instead. I am trying to make a measure that will automatically change the newest date and subtracting/dividing/others when the newest week is in.

Anything would help,

Thanks

This is an example of a weeks worth of  datesThis is an example of a weeks worth of dates

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Anonymous - Is this in DAX, Power Query or do you care? In DAX, you could just do something like:

 

Measure = 

  VAR __Max = MAX('Table'[Week])

...

RETURN

...

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

It does not matter. I dont want the actual number of the week pulled, I want the data from that week pulled. Like if i wanted to have a function that does Cases recieved/Cases ordered. I want that same function running every week but with the data from the newest week. This weeks cases ordered. Not last week. When I did the Var_Max it would pull the actual number for the week. 

@Anonymous Oh, look at Lookup Min/Max - https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

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.