cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Dates!!

Hi,

Below is the table I'm working on, to which I'm to add another column that will display the Friday's date of the week in all its rows.

 

Date                Day   

12/5/2019      Sun   

13/5/2019      Mon        

14/5/2019      Tue

15/5/2019      Thurs

16/5/2019      Fri

17/5/2019      sat

 

I expect as the following output:

 

Date                Day         Expected Output

12/5/2019      Sun         17/5/2019      

13/5/2019      Mon        17/5/2019         

14/5/2019      Tue          17/5/2019      

15/5/2019      Wed        17/5/2019      

16/5/2019      Thur        17/5/2019      

17/5/2019      Fri           17/5/2019   

18/5/2019      Sat          24/5/2019

19/5/2019      Sun         24/5/2019

20/5/2019      Mon        24/5/2019

21/5/2019      Tues        24/5/2019

22/5/2019      Wed        24/5/2019

23/5/2019      Thurs      24/5/2019

24/5/2019      Fri           24/5/2019

23/5/2019      Sat          24/5/2019

 

Using dax how can I achieve this one.

 

 

 

 

 

1 ACCEPTED SOLUTION

MyFriday = CALCULATE(MAX('Table'[Date]), FILTER('Table', 'Table'[Weeknum] = EARLIER('Table'[Weeknum]) && 'Table'[Day] = "Fri"))


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

3 REPLIES 3
hnguy71
Solution Sage
Solution Sage

Is this the result you are expecting?

 

result_date.png



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Anonymous
Not applicable

Thanks for your reply.  I have formed the weeknum column, could you please let me know how you created MyFriday column or attach Pbix file, it will be helpful for me

 

Regards,

Yuvaraj

MyFriday = CALCULATE(MAX('Table'[Date]), FILTER('Table', 'Table'[Weeknum] = EARLIER('Table'[Weeknum]) && 'Table'[Day] = "Fri"))


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors