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
peterh
Regular Visitor

FIRSTDATE() Issue

I have created measures using FIRSTDATE() and LASTDATE() and named them Selected Start Date and Selected End Date, respectively. I have added these values as filters to other measures. For filtering, I have added month and year slicers to filter a calendar table.

 

As an example, I have selected May 2016 in the slicers. When I add the Selected Start Date value to the page, the value shows up as 5/1/2016. When I look at measures using the Selected Start Date value, it uses 1/1/1900 as the date. Why would the value be correct on the page but incorrect in the measures using the Selected Start Date value? The Selected End Date shows up correctly in the other measures.

1 REPLY 1
v-micsh-msft
Microsoft Employee
Microsoft Employee

Hi peterh,

 

Would you please share the measure you used here? As the date 1/1/1900 ( I should say, this is a leap year, but the date function sometimes not agree with that) returned, you might hit some interesting things when using date and time functions. : ) 

FIRSTDATE () (LASTDATE () ) function would return the first date (last date) in the current context for the specified column of dates. The current context means the context which the measure calculated in.

Regarding the situation you mentioned, I suggest we check the following two parts first:

1. Check the Visual Interaction setting (Power BI desktop, when selecting Visuals, choose format tab ->Edit Interactions) between the slicer and the measure using FIRSTDATE () function;

2. Verify the measure itself, see if there are any calculated filters in this measure which would remove the Slicer filter, such as all function.

Regards

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.