cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
handrianto
New Member

inconsistent weekend weekday DAX calculated value

I use DAX function: GetWeekDay = WEEKDAY(WEEKDAY([DropOffTimeLocal].[Date],2)) to get the weekday value. Apparently, it has  different result for the same day. for the same March 3, 2017 and March 10, 2017. the weekday function return 2 different values. wheres it is a Friday (value 5), instead some of them return Saturday (value 6)

 

inconsistent weekend - weekday identifier.JPG

 

Is it a bug in function or not ?

 

Thanks a lot for your response..

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-qiuyu-msft
Moderator

Re: inconsistent weekend weekday DAX calculated value

Hi @handrianto,

 

I notice that the date place in the table visual is [PickUpTimeLocal], while the GetWeekDay = WEEKDAY([DropOffTimeLocal].[Date],2).

 

And I also find there are records [PickUpTimeLocal] date is not equal to the [DropOffTimeLocal] date. As you compare the [PickUpTimeLocal] date with the weekday value from the [DropOffTimeLocal], the result you get is expected.

 

q5.PNG

 

Best Regards,
Qiuyun Yu

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

View solution in original post

4 REPLIES 4
Moderator v-qiuyu-msft
Moderator

Re: inconsistent weekend weekday DAX calculated value

Hi @handrianto,

 

In your scenario, please remove the one WeekDay() function and keep only one like below:

 

GetWeekDay = WEEKDAY(WEEKDAY([Date].[Date],2))

 

Also please try to run the desktop version latest one 2.46.4732.721 64-bit (May 2017). If issue persists, please share .pbix file if possible.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
handrianto
New Member

Re: inconsistent weekend weekday DAX calculated value

Hi Qiuyun Yu, Thanks for the response. I've already update PBI Desktop to the latest update May 2017. I've corrected the DAX function (silly me) as you suggest. GetWeekDay = WEEKDAY([DropOffTimeLocal].[Date],2). but apparently after re-run the function and I checked the table test result; it is still the same.

in fact now I notice it is randomly occur in other dates.

 

DAX.JPGDAX functionPBI Desktop.JPGPBI Desktop Versionresult March 8.JPG8 marchresult March 9.JPG9 Marchresult March 10.JPG10 March

Moderator v-qiuyu-msft
Moderator

Re: inconsistent weekend weekday DAX calculated value

Hi @handrianto,

 

I notice that the date place in the table visual is [PickUpTimeLocal], while the GetWeekDay = WEEKDAY([DropOffTimeLocal].[Date],2).

 

And I also find there are records [PickUpTimeLocal] date is not equal to the [DropOffTimeLocal] date. As you compare the [PickUpTimeLocal] date with the weekday value from the [DropOffTimeLocal], the result you get is expected.

 

q5.PNG

 

Best Regards,
Qiuyun Yu

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

View solution in original post

handrianto
New Member

Re: inconsistent weekend weekday DAX calculated value

Ah.. How can I do such silly mistake.. I copy paste the DAX from other BI report and forgot to change the column reference from droptime into pickuptime. didn't catch that for 2 days.

 

Thank you very much for your help Quiyu..

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors