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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
zfemmer
Helper I
Helper I

Dax - Period To Date This Week Vs. Last Week

I am trying to have a line graph that displays last week's revenue and this week's revenue period to date.

I have figured out this week with this:

VAR _PeriodToDate =
CALCULATE(
    SUM(RevenueChannel[BookedRevenue]),
    'Date'[Date] <= _MaxDate,
        FILTER(ALL('Date'),
        'Date'[Date] < TODAY() &&
        'Date'[Date] >= TODAY() - 7
        )
)

 

But cannot seem to figure out how to do the last week. I know I can easily just do this:

VAR _PeriodToDateTest =
CALCULATE(
    SUM(RevenueChannel[BookedRevenue]),
    'Date'[Date] <= _MaxDate,
        FILTER(ALL('Date'),
        'Date'[Date] < TODAY() - 7 &&
        'Date'[Date] >= TODAY() - 14
        )
)

 

But then they do not line up on the line graph:

zfemmer_0-1603148356334.png

Does anyone know how I would accomplish this?

1 ACCEPTED SOLUTION
zfemmer
Helper I
Helper I

I was way overthinking it...

CALCULATE(
    SUM(RevenueChannel[BookedRevenue]),
    'Date'[Date] <= _MaxDate - 7,
        FILTER(ALL('Date'),
        'Date'[Date] < TODAY() - 7 &&
        'Date'[Date] >= TODAY() - 14
        )
)

View solution in original post

1 REPLY 1
zfemmer
Helper I
Helper I

I was way overthinking it...

CALCULATE(
    SUM(RevenueChannel[BookedRevenue]),
    'Date'[Date] <= _MaxDate - 7,
        FILTER(ALL('Date'),
        'Date'[Date] < TODAY() - 7 &&
        'Date'[Date] >= TODAY() - 14
        )
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.