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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

date function giving error for month of October 2017 Only !

 

This issue relates to the dax Date() function.

 

It's giving wrong values in visuals e.g. a table visual for dates in October 2017, BUT is correct for all other dates AND/BUT shows semi correct data in the table data view.

 

I'm using the date function in the context of this dynamic filter http://radacad.com/dynamic-date-range-from-slicer by @Phil_Seamark .

 

Thats the context of the use of the function. The dynamic filter works great. Then by chance I stumbled on these erroneous dates.

 

It was driving me bonkers and thought it was my data or some filtering I wasn't seeing. But I've now replicated the error in a separate power bi file with none of the dynamic filter setup added and generic series generated dates.

 

The filter in Phils post requires a calculated date column consisting of the first day in the month in which the reference date occurs.

 

As discussed in Phils post a table of generic dates is generated with

 

ADDCOLUMNS(
		GENERATE(
			CALENDAR("2012-01-01",TODAY()) ,
			SELECTCOLUMNS(GENERATESERIES(1,2),"Units Sold",RANDBETWEEN(1,5))
			),
		"Month" , DATE(YEAR([Date]),MONTH([Date]),1))

 

resulting in data like

 

 

BUT !!

 

out of all the data in this series dates that are in October 2017 are giving the wrong Month column values in visuals.

 

There's two errors.

 

1. The first day of october in the generated series is showing 30/09/17 instead of 01/10/17. But then the series contiues correctly from 02/10/17 onwards

 

2. The calculated Month that should be 01/01/17 is also showing 30/09/17 for all remaining dates in october 2017.  Then contiues correctly from 01/11/17 onwards. see below.

 

it's good for ALL !! dates prior... then for october gives the error....

 

 

pbi_marked.jpg 

Then goes back to correct value in november

 

pbi2.JPG

 

 

BUT the data is partially correct in the table view of data.

 

A spurious / duplicate series value of 30/09/17 is addded. But the calculated Month date is correct.

 

 

 

pbi3_marked.jpg

 

 

 If others can replicate this would be great. 

 

Can anyone figure out the cause ??

 

My best guess is a date function error with the number of days in the month of September or October 2017

 

But is there some simple thing I've missed ?

 

Cheers

 

Simon

 

1 REPLY 1
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous

 

Based on my test, I cannot reproduce the same issue as you said . You may try to check if it has any filters.  If it is not your case, please share your file. You can upload it to OneDrive or Dropbox and post the link here.

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.