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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

previous week

Hi, 

I would like to create a measure that allowed me to show the previous week value. 

When the user click wk 32, then the graph will shown the current week (wk32) and previous week (wk31) data in a graph. 

 

the graph is clustered column chart and the xaxis will be category, weekday short; yaxis will be previous week (light colour) and current week (dark colour). 

 

Previous Week = calculate(sum('Flow '[Value]),FILTER(all('Calendar'),'Calendar'[Date]=MAX('Calendar'[Date])-7))

 

current week=sum('Flow'[Value])

The issue that i having now is the pic 1 is under category (for the previous week suppose the sum of pic 2 but just obtain sunday value).  Can anyone help me to change the previous week dax so that the under category can get the sum from monday to sunday. 

 

Thanks for your help. 

Kim_Sky_0-1660809787417.png(pic1)

Kim_Sky_1-1660809802949.png(pic2)

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Make sure calendar table is maked as date table and Weekday are coming from calendar table.

 

Try like

 

Previous Week = calculate(sum('Flow '[Value]),Dateadd('Calendar'[Date],-7, Day))

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Make sure calendar table is maked as date table and Weekday are coming from calendar table.

 

Try like

 

Previous Week = calculate(sum('Flow '[Value]),Dateadd('Calendar'[Date],-7, Day))

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak ,

 

It works what I want. Thanks a lot

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors