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
davidibarrag
Frequent Visitor

SELECT the starting day

Hello 

I want to know how to calculate a measure starting the week on friday so when I aggregate my measure by week in a vizual the caluclation of the weeks starts on friday and ends on thursday in every week. ejemplo.png

For example, in this chart i have my sales by week of the year, so I want to calculate my sales by week of the year but that every week start in friday and end in thursday, so i need a way to make my sales measure calculate my sales by week but starting on friday

1 ACCEPTED SOLUTION

HI @davidibarrag ,

You can use following calculated column formula to check date and return week number.(Friday to Thursday)

weeknum =
IF (
    MONTH ( [Date] ) = 1
        && WEEKNUM ( [Date] - 4, 2 ) > 50,
    1,
    WEEKNUM ( [Date] - 4, 2 )
)

After you create above column, you can use it as condition of filter and summary records.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @davidibarrag ,

 

Check the forum post believe that this can help you achieve what you need.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hello, i enter to the link you gave and that is not what i needed. Maybe i do not explain myself the right way. 

Ejemplo1.jpg

I need to create a measure that calculate the sales by week of year and week of month, but each week need to start in thursday and end in friday, and graph that measure by week in Power BI. Hopefully i explain myself better this time.

HI @davidibarrag ,

You can use following calculated column formula to check date and return week number.(Friday to Thursday)

weeknum =
IF (
    MONTH ( [Date] ) = 1
        && WEEKNUM ( [Date] - 4, 2 ) > 50,
    1,
    WEEKNUM ( [Date] - 4, 2 )
)

After you create above column, you can use it as condition of filter and summary records.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.