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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
chethan
Resolver III
Resolver III

Week End Date With Text WE

Hi,

 

I need Weekend date Satuarday With Text by Adding "WE" below is the example.

 

please help

 

Thanks in Advance.

 

 

Order NumberOpened DateWeek - Open
98243622103/11/2015WE 14-Mar-15
98243622113/6/2015WE 7-Mar-15
98243622123/27/2015WE 28-Mar-15
98243622138/18/2015WE 22-Aug-15
98243622143/17/2015WE 21-Mar-15
98243622155/2/2015WE 2-May-15
98243622168/18/2015WE 22-Aug-15
98243622173/9/2015WE 14-Mar-15
98243622183/11/2015WE 14-Mar-15
98243622192/20/2015WE 21-Feb-15
98243622203/9/2015WE 14-Mar-15
982436222111/20/2015WE 21-Nov-15
98243622222/24/2015WE 28-Feb-15
98243622238/27/2015

WE 29-Aug-15

 

 

 

Regards,

Chethan K

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @chethan,

 

Pleaser refer to the following steps.

  1. Create a calendar table: 
    DateTable = CALENDAR(DATE(2015,1,1),DATE(2015,12,31))
  2. In this calendar table, add two calculated columns: 
    WeekDay = WEEKDAY(DateTable[Date],2)
  3. SaturdayInDateTable =
        DATEADD ( DateTable[Date], 6 - DateTable[WeekDay], DAY )
  4. In your source table, add two calculated columns: 
    Saturday =
        LOOKUPVALUE (
            DateTable[SaturdayInDateTable],
            DateTable[Date], 'WEEK-date'[Opened Date]
        )
    
    Week-Open =
        "WE  " & 'WEEK-date'[Saturday].[Day]
            & "-"
            & LEFT ( 'WEEK-date'[Saturday].[Month], 3 )
            & "-"
            & RIGHT ( 'WEEK-date'[Saturday].[Year], 2 )

 

If you still have any question, please feel free to ask.

 

Thanks,
Yuliana Gu

Community Support Team _ Yuliana Gu
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

6 REPLIES 6
v-yulgu-msft
Employee
Employee

Hi @chethan,

 

Pleaser refer to the following steps.

  1. Create a calendar table: 
    DateTable = CALENDAR(DATE(2015,1,1),DATE(2015,12,31))
  2. In this calendar table, add two calculated columns: 
    WeekDay = WEEKDAY(DateTable[Date],2)
  3. SaturdayInDateTable =
        DATEADD ( DateTable[Date], 6 - DateTable[WeekDay], DAY )
  4. In your source table, add two calculated columns: 
    Saturday =
        LOOKUPVALUE (
            DateTable[SaturdayInDateTable],
            DateTable[Date], 'WEEK-date'[Opened Date]
        )
    
    Week-Open =
        "WE  " & 'WEEK-date'[Saturday].[Day]
            & "-"
            & LEFT ( 'WEEK-date'[Saturday].[Month], 3 )
            & "-"
            & RIGHT ( 'WEEK-date'[Saturday].[Year], 2 )

 

If you still have any question, please feel free to ask.

 

Thanks,
Yuliana Gu

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

@v-yulgu-msft Thanks for replay.

 

please suggest how to sort the data in dashboard by week wise

 

 

Regards,

Chethan K

Hi @chethan,

 

Would you please describe your requirement more clearly? Can you show me the expect output?

 

Thanks,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Do you have a Date/Calendar dimension table with a Week Ending column (e.g. http://www.mattmasson.com/2014/02/creating-a-date-dimension-with-a-power-query-script/)that is linked to your data table?

 

If so, you can create "Week - Open" as a new column:

Week - Open = "WE " & FORMAT(RELATED(DimDate[Week Ending]), "dd-MMM-yyyy")

Note that I had problems with the "Week Ending" column in my DimDate table falling on a Sunday until I specifically set the start of week to Sunday per below (even though that's the default, and my locale is set OK):

WeekEnding = Table.AddColumn(#"YOUR PREVIOUS STEP", "Week Ending", 
        each Date.EndOfWeek([Date], Day.Sunday), type date)

@Anonymous

 

its not working

Anonymous
Not applicable

Sorry, which bit isn't working?  What result are you geting that is not as expected?

 

Can you post a screenshot etc.?

 

Cheers.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.