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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cmills_Greystar
Frequent Visitor

Need to create a measure to find the most recent Activated Date in a table based on a Slicer

I need to create a measure that will return the most recent activated date based on a slicer that uses the Month End field.  

 

I have a Date table that contains daily dates as well as the corresponding month end date.  I have a second table of accounts that contains the date the account was activated and the balance listed. Here is an excerpt from that table:

 

 

Account #Activated OnBalance Listed
4842004210/26/20232227.58
5862873210/23/2023208.42
9608454310/21/2023518.97
205792359/15/2023500.1
219812569/14/202312894.01
644002449/12/20231477.34
682541248/31/202323521.16
352579218/22/20237664.71
174815608/17/20236466.5
346258948/10/2023806.8
680584648/3/2023676.86
446651897/18/2023277.33
632839507/18/2023468.71
779647107/10/2023315.66
479512075/24/20235164.04
211956655/18/2023189.8
565817644/21/2023724.22
423402534/21/2023289.58
534562824/21/202378.2
480977704/10/2023150.34
825398654/10/2023148.5
285752294/3/20231080.63
890745083/10/2023534.16
675781253/1/20231150.48
866027982/28/202365.2
467178601/31/20233821.52
176262581/12/2023496.28
961636171/4/2023399.53
496215851/4/202310357.32

 

So, for example: 

Slicer Selection = 9/30/2023, Most Recent Listed = 9/15/2023  (omitting all three dates from October)

Slicer Selection = 6/30/2023, Most Recent Listed = 5/24/2023 (No listings in the month of June, so it goes back to the most recent file prior to that)

Slicer Selection = No Date Selected, Most Recent Listed = 10/26/2023

 

This is the measure I have right now: 

Last Listed Date =

var SelectedDate = MAX(Date_Lookup_Table[MonthEnding])

RETURN
    CALCULATE(
        MAX(Files_Activation_Info[Activated On]),
        FILTER(
            Files_Activation_Info,
            Files_Activation_Info[Activated On] <= SelectedDate)
        )
 
But it is only returning the dates from WITHIN the month selected. So if I select 6/30/2023, it will return blank.

 

12 REPLIES 12
Anonymous
Not applicable

Hi @cmills_Greystar ,

Use the below measure

Measure = 
 var mxd= MAX(Calender[Date])
 var maxdt=CALCULATE(MAX(Date_Lookup_Table[Activated On]),FILTER(all(Date_Lookup_Table),Date_Lookup_Table[Activated On]<=mxd))
 Return
 maxdt

I've already attempted that. a version of that formula is in my original post at the bottom. 

 

But it is only returning the dates from WITHIN the month selected. So if I select 6/30/2023, it will return blank.

 
Anonymous
Not applicable

In my case it is returning 24-05-2023

anilkapkoti_0-1698345258367.png

 

 

Anonymous
Not applicable

Can you share the expected output from the above table? It will help to understand and provide a solution 

I have included my expected result in my post above in the section where it says "So, for example" 

What should happen when you select 4/30/2023 in your slicer?

It should return 4/21/2023 as a singular value. While there are three accounts listed on that day, All I'm looking for is that is the latest date on/prior to the selected date in my slicer. 

lbendlin
Super User
Super User

Your tables need to be disconnected.

What does that mean?  Remove the Relationship?

either remove it or make it inactive (so you can use it with USERELATIONSHIP in a measure when needed)

That does not solve the issue.  Now the slicer doesn't change what is returned at all.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (1,853)