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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
AT150745
Frequent Visitor

Help Needed: DAX Formula for Calculating 10-Day Rolling Percentage Change in Power BI

Hello everyone,

I'm working on a Power BI report where I need to calculate the percentage change in sales over a rolling 10-day period. Below is the DAX formula I'm currently using: 

M_TSS_7D_PW% =
VAR __PREV =
CALCULATE(
SUM('Fact Sales Daily 7D'[Gross Sale 7D]),
DATEADD('Dimension Time'[Date], -7, DAY)
)
RETURN
DIVIDE(
SUM('Fact Sales Daily 7D'[Gross Sale 7D]) - __PREV,
__PREV
)

 

To calculate the 10-day rolling percentage change, I use the following formula:

TSS PW 10D =
CALCULATE(
[M_TSS_7D_PW%],
DATESINPERIOD(
'Dimension Time'[Date],
MAX('Dimension Time'[Date]),
-10,
DAY
)
)

The issue I'm facing is that the result starts displaying from the 24th instead of the 31st. I need the calculation to begin from the latest date (31st) in my data.

Here's a screenshot of the current output:

AT150745_0-1723608577424.png

As you can see, the calculation starts on the 24th, but I need it to start on the 31st. Could anyone help me understand why this is happening and how to adjust the formula so that the results start displaying from the 31st?

Thanks in advance for your assistance!

3 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @AT150745,

 

I was able to use your formula in my testing to show values from the 31st to previous dates.

vdengllimsft_0-1723623708139.png

 

The columns in the matrix are the formatted calculated columns in /Dimension Time/ table.

vdengllimsft_1-1723623742302.png

 

TSS PW 10D is a value in the Category column of the Dimension Time table.

vdengllimsft_2-1723623755342.png

Could you provide the relevant data (pbix files) to facilitate my further testing?


Best Regards,

Dengliang Li

 

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

Hi,

I need assistance with calculating the percentage change between sales or values for the current week and the previous week in Power BI. I also need to ensure that I can display values for the next 10 days based on a filter.

Here's what I would like to achieve:

  1. Calculate Percentage Change: I want to calculate the percentage change between sales or values for the current week and the previous week. The calculation should compare values for the same day of each week.

  2. Display Values for Next 10 Days: The report should be able to show values for the next 10 days from the selected date filter.

Could you please provide guidance or a DAX formula that will help me accomplish this?

Thank you in advance for your help!

Best regards,
Dengliang Li

View solution in original post

Anonymous
Not applicable

Hi @AT150745,


You can use the first DAX formula in your posted question to implement the calculation of the percentage change between the current week's and the previous week's sales or values.

 

M_TSS_7D_PW% =
VAR __PREV =
CALCULATE(
SUM('Fact Sales Daily 7D'[Gross Sale 7D]),
DATEADD('Dimension Time'[Date], -7, DAY)
)
RETURN
DIVIDE(
SUM('Fact Sales Daily 7D'[Gross Sale 7D]) - __PREV,
__PREV
)

 

 

You can use the filter's Relative Date to display values for how many days in the future from today.

vdengllimsft_0-1723692054274.png

 

Best Regards,

Dengliang Li

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @AT150745,

 

I was able to use your formula in my testing to show values from the 31st to previous dates.

vdengllimsft_0-1723623708139.png

 

The columns in the matrix are the formatted calculated columns in /Dimension Time/ table.

vdengllimsft_1-1723623742302.png

 

TSS PW 10D is a value in the Category column of the Dimension Time table.

vdengllimsft_2-1723623755342.png

Could you provide the relevant data (pbix files) to facilitate my further testing?


Best Regards,

Dengliang Li

 

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

Hi,

I need assistance with calculating the percentage change between sales or values for the current week and the previous week in Power BI. I also need to ensure that I can display values for the next 10 days based on a filter.

Here's what I would like to achieve:

  1. Calculate Percentage Change: I want to calculate the percentage change between sales or values for the current week and the previous week. The calculation should compare values for the same day of each week.

  2. Display Values for Next 10 Days: The report should be able to show values for the next 10 days from the selected date filter.

Could you please provide guidance or a DAX formula that will help me accomplish this?

Thank you in advance for your help!

Best regards,
Dengliang Li

Anonymous
Not applicable

Hi @AT150745,


You can use the first DAX formula in your posted question to implement the calculation of the percentage change between the current week's and the previous week's sales or values.

 

M_TSS_7D_PW% =
VAR __PREV =
CALCULATE(
SUM('Fact Sales Daily 7D'[Gross Sale 7D]),
DATEADD('Dimension Time'[Date], -7, DAY)
)
RETURN
DIVIDE(
SUM('Fact Sales Daily 7D'[Gross Sale 7D]) - __PREV,
__PREV
)

 

 

You can use the filter's Relative Date to display values for how many days in the future from today.

vdengllimsft_0-1723692054274.png

 

Best Regards,

Dengliang Li

 

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.