Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello,
I have a Power BI dashboard and I am trying to determine what is the % change from one week to the next. I have a Date Table and have created a relationship between the Date Table and the Date in my file and that works great.
This is what I currently have. You will see it is a breakdown for different file sizes week over week beginning on 1/1/2024 through 4/8/2024. I need to know the percentage change difference from one week to the next and display it like the "%Weekly Change" row you see. But the percentages you see are all incorrect and is just there as a placeholder.
For example, the week of 1/1/2024 shows total rows of 243,419 the next week of 1/8/2024 shows total rows of 242,254. I need a DAX measure/formula that will help me calculate what was the percentage of change between the number of rows from the previous week to the current week. Each week starts on a Monday. I will need this measure to continue throughout the rest of 2024, 2025, etc. Is anyone able to help me figure this out? I appreciate any assistance I can get.
Solved! Go to Solution.
Hi @ll0606 ,
Based on my testing, please try the following methods:
1.Create the sample table.
2.Create the measure to calculate the change between the previous week and current week.
weekly change =
var date_ = SELECTEDVALUE('Table'[Date])
VAR current_sum =
CALCULATE (
SUM ( 'Table'[Number]),
FILTER(ALL('Table'), 'Table'[Date] = date_)
)
VAR sum_preWeek =
CALCULATE (
SUM ( 'Table'[Number]),
FILTER(ALL('Table'), 'Table'[Date] = date_ - 7)
)
VAR min_week =
CALCULATE(MIN('Table'[Date]), ALLSELECTED('Table'[Date]))
RETURN
IF(date_ = min_week, BLANK(), DIVIDE((current_sum - sum_preWeek ), sum_preWeek))
3.Drag the measure into the matrix visual. Change the data Format.
4.The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ll0606 ,
Based on my testing, please try the following methods:
1.Create the sample table.
2.Create the measure to calculate the change between the previous week and current week.
weekly change =
var date_ = SELECTEDVALUE('Table'[Date])
VAR current_sum =
CALCULATE (
SUM ( 'Table'[Number]),
FILTER(ALL('Table'), 'Table'[Date] = date_)
)
VAR sum_preWeek =
CALCULATE (
SUM ( 'Table'[Number]),
FILTER(ALL('Table'), 'Table'[Date] = date_ - 7)
)
VAR min_week =
CALCULATE(MIN('Table'[Date]), ALLSELECTED('Table'[Date]))
RETURN
IF(date_ = min_week, BLANK(), DIVIDE((current_sum - sum_preWeek ), sum_preWeek))
3.Drag the measure into the matrix visual. Change the data Format.
4.The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
12 | |
10 | |
10 | |
8 |
User | Count |
---|---|
16 | |
15 | |
15 | |
12 | |
10 |