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
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
Employee
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
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.