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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
NewbieJono
Post Partisan
Post Partisan

Previous Week a month Month and Year earlier

Hello, is there a method to get these results with DAX based on one slicer. what I need it the results of a week from four weeks ago and the same week a year ago.

 

I have a date table set up with the week commencing field. I can easily get the green section, but I am not sure about the Dax to get the orange, if its possible.

 

Capture1.PNG

 

 

1 ACCEPTED SOLUTION

You are incorrectly using inbuilt time intelligence. Read the rules here 

https://exceleratorbi.com.au/power-bi-calendar-tables/

you must have a calendar table at the day level of granularity. Your measure refers to the week ending date. It should be calendar date in a calendar table at the day level



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi  @NewbieJono ,

Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!

 

 

Best Regards

Yilong Zhou

 

NewbieJono
Post Partisan
Post Partisan

Any ideas on why this does not bring back volumes? There are volumes last year

 

Capture100.PNG

You are incorrectly using inbuilt time intelligence. Read the rules here 

https://exceleratorbi.com.au/power-bi-calendar-tables/

you must have a calendar table at the day level of granularity. Your measure refers to the week ending date. It should be calendar date in a calendar table at the day level



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

Hi @NewbieJono ,

I think you can try the following DAX code, it might be able to give you some help.

4 Week Before = 
CALCULATE (
    [YourMeasure],
    DATEADD ( 'DateTable'[WeekCommencing], -4, WEEK )
)
1 Year before = 
CALCULATE (
    [YourMeasure],
    SAMEPERIODLASTYEAR ( 'DateTable'[WeekCommencing] )
)

From your screenshot I think there is some difficulty in trying to reproduce the results you want, if you can provide the .pbix file or more data I will reproduce the desired results for you.

 

 

 

Best Regards

Yilong Zhou

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

 

Thanks for your help with this. The WEEK bit seems to error?Capture1111.PNG

MattAllington
Community Champion
Community Champion

Yes. It's called time intelligence and you can read about it here https://exceleratorbi.com.au/dax-time-intelligence-beginners/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.