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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Shak_95
Frequent Visitor

Calculate the date up current week and up last week

Hi All,

 

This is the first time I have the honor to communicate with you.

 

I need a way to show 2 indicators :

1- A indicator to show the data from the start date up to the current week

2- A indicator to show the data from the start date up to last week

 

note, the weekday starts on Sunday and ends on Thursday.

 

 

Thanks for All,

 

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Shak_95 ,

 

Please check if this could meet your requirements:

 

1- A indicator to show the data from the start date up to the current week

 

This Week =
VAR Today_ =
    TODAY ()
VAR _endOfWeekDate =
    Today_ + 7
        - WEEKDAY ( Today_, 1 )
RETURN
    CALCULATE (
        SUM ( Table1[Value] ),
        Table1[Date] <= _endOfWeekDate,
        WEEKDAY ( Table1[Date], 1 ) IN { 1, 2, 3, 4, 5 }
    )

 

 

2- A indicator to show the data from the start date up to last week

 

Previous Week =
VAR Today_ =
    TODAY ()
VAR _endOfLastWeekDate =
    Today_ - WEEKDAY ( Today_, 1 )
RETURN
    CALCULATE (
        SUM ( Table1[Value] ),
        Table1[Date] <= _endOfLastWeekDate,
        WEEKDAY ( Table1[Date], 1 ) IN { 1, 2, 3, 4, 5 }
    )

 

 

 

If this couldn't help you, please check:

How to Get Your Question Answered Quickly - Microsoft Power BI Community

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,

Icey

 

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

1 REPLY 1
Icey
Community Support
Community Support

Hi @Shak_95 ,

 

Please check if this could meet your requirements:

 

1- A indicator to show the data from the start date up to the current week

 

This Week =
VAR Today_ =
    TODAY ()
VAR _endOfWeekDate =
    Today_ + 7
        - WEEKDAY ( Today_, 1 )
RETURN
    CALCULATE (
        SUM ( Table1[Value] ),
        Table1[Date] <= _endOfWeekDate,
        WEEKDAY ( Table1[Date], 1 ) IN { 1, 2, 3, 4, 5 }
    )

 

 

2- A indicator to show the data from the start date up to last week

 

Previous Week =
VAR Today_ =
    TODAY ()
VAR _endOfLastWeekDate =
    Today_ - WEEKDAY ( Today_, 1 )
RETURN
    CALCULATE (
        SUM ( Table1[Value] ),
        Table1[Date] <= _endOfLastWeekDate,
        WEEKDAY ( Table1[Date], 1 ) IN { 1, 2, 3, 4, 5 }
    )

 

 

 

If this couldn't help you, please check:

How to Get Your Question Answered Quickly - Microsoft Power BI Community

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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