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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Eldin
Regular Visitor

Time Periods

Hello,

 

I've been searching a lot for some good Time Periods in DAX or M Queries, but can't seem to find something that helps me. Everytime there is something missing in order to get the full solution. 

 

So, what i want is following:

 

To have a DAX-measure or M-query that shows:

- Today

- Yesterday

- Current week 

- Last week (most important)

- This month

- Last Month 

- Custom

 

What I have created so far is this, maybe if someone knows what code I need to put in to get "Last week" or "Today". That would be really helpful. 

Eldin_0-1644336334570.png

And I will then filter all my data according to if it corresponds to these periods. 

1 ACCEPTED SOLUTION
Eldin
Regular Visitor
3 REPLIES 3
Alex_T
Frequent Visitor

Hi @Eldin ,

Nice find, that Chris Webb stuff is very good, you may also want to check out...

Guy in a Cube, who discusses this stuff, Working with Time Periods in Power BI - YouTube

They reference a Phil Seamark article on this, Row-based Time Intelligence - Phil Seamark on DAX who offer a DAX and TSQL solution and to Fourmoo, Create Dynamic Periods for Fiscal or Calendar Dates in Power BI - Data Analytics | FourMoo and Power... who offer more on M-query solution (and refer to another Seamark article).

Love this stuff, hopefully we'll be having an implementation of this in our Data Warehouse soon, good for the users but also good for devs as it can simplify our measures 🙂

Eldin
Regular Visitor

AlexisOlson
Super User
Super User

I think calculation groups might be a better approach to this concept.

 

Check out these resources:

https://p3adaptive.com/2021/03/calculation-groups-to-the-rescue/

https://www.sqlbi.com/articles/introducing-calculation-groups/

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.