Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Solved! Go to Solution.
Hi @Anonymous ,
According to your description, I create a sample.
Electrical table:
Calendar table with its week num.
Here's my solution, create a measure:
Previous Week Electricity =
IF (
ISINSCOPE ( 'Calendar'[Week Num] ),
CALCULATE (
SUM ( Electrical[Value] ),
'Calendar'[Week Num]
= MAX ( 'Calendar'[Week Num] ) - 1
),
CALCULATE (
SUM ( Electrical[Value] ),
FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] = MAX ( 'Calendar'[Date] ) - 7 )
)
)
Get the correct result.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, I create a sample.
Electrical table:
Calendar table with its week num.
Here's my solution, create a measure:
Previous Week Electricity =
IF (
ISINSCOPE ( 'Calendar'[Week Num] ),
CALCULATE (
SUM ( Electrical[Value] ),
'Calendar'[Week Num]
= MAX ( 'Calendar'[Week Num] ) - 1
),
CALCULATE (
SUM ( Electrical[Value] ),
FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] = MAX ( 'Calendar'[Date] ) - 7 )
)
)
Get the correct result.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Kim_Sky,
As you see in below DAX mentioned by you, you are trying to filter maxdate - 7 means only one day.
Previous Week Electricity = calculate(sum(Electrical[Value]),FILTER(all('Calendar'),'Calendar'[Date]=MAX('Calendar'[Date])-7))
Appreciate a Kudos!
If this helps and resolves the issue, please mark it as a Solution!
Regards,
N V Durga Prasad
Hi @nvprasad
I have try to using calendar [week num] for calculate one week before, but in the graph for daily the value won't be changed.
Are there any recommended dax that I can use?
Thanks for your help
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 120 | |
| 95 | |
| 70 | |
| 69 | |
| 65 |