Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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....
Then goes back to correct value in november
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.
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
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.
Regards,
Cherie
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
86 | |
85 | |
67 | |
49 |
User | Count |
---|---|
134 | |
113 | |
100 | |
68 | |
67 |