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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors