Reply
davidibarrag
Helper I
Helper I

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.
avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)