cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sraj
Post Patron
Post Patron

calendar table with Sunday

Hi there,

 

I have created a calendar table separately because I wanted to showcase the days of the week and I used the below to create a column called MONTH DAY

Month Day = FORMAT([Date],"MMM dd") & " " & FORMAT('Calendar Table'[Date],"dddd")
 
sraj_0-1643397158957.png

 

But now I have the request to show only Sunday as the day on there like for e.g. Dec 01, Dec 02, Dec 03, Dec 04, Dec 05 Sunday, Dec 06, Dec 07, Dec 08, Dec 09, Dec 10, Dec 11, Dec 12 Sunday.  Can someone please advise if there is something I can add to the function to achieve this??

 

 

1 ACCEPTED SOLUTION
rsbin
Super User
Super User

@sraj 

My test seems to show this works:

Month Day = FORMAT([Date],"MMM dd") & " " & IF( FORMAT([Date],"dddd") = "Sunday", FORMAT([Date],"dddd", "" ))

Might be a cleaner way write it, but the concept works.

Hope it works out for you.

Regards,

View solution in original post

7 REPLIES 7
sraj
Post Patron
Post Patron

Yes, that worked.  Thanks for pointing it out!!

@sraj,

Glad that you got it to work.  Happy to help!

rsbin
Super User
Super User

@sraj 

My test seems to show this works:

Month Day = FORMAT([Date],"MMM dd") & " " & IF( FORMAT([Date],"dddd") = "Sunday", FORMAT([Date],"dddd", "" ))

Might be a cleaner way write it, but the concept works.

Hope it works out for you.

Regards,

Thanks for responding!!  I am not very good with this so I dont know how to correct these squiggle errors

 

sraj_0-1643403379244.png

 

@sraj,

Please copy and paste your formula as text (like you did in your original post) - not as a picture.  I will try to see if I can spot the error.

Month Day = FORMAT([Date],"MMM dd") & " " & FORMAT('Calendar Table'[Date],"ddd") = "Sunday", FORMAT([Date],"dddd", "" ))

@sraj,

You did not put in the "IF" statement after the second "&".   This is what makes the formula work!

You should be able to just copy and paste what I gave you.

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

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.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors
Users online (660)