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
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!:
The Definitive Guide to Power Query (M)

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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.