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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
lockmirbee
New Member

PREVIOUSMONTH: what is the underlying Calculate+Filter in DAX?

Unfortunately i'm working for a company that doesn't report on a week or month basis, but on a period basis. Every quarter has 3 periods: of 4, 4 and a 5 week period. Therefore, i can't use time-intelligence functions like PreviousMonth to jump between Periods.

 

Luckely my dataset always has the Periodnumber + ISOyear in the dataset, and lower levels like weeks and days are never relevant for me as financial reporter. So i've tried making Fake date-column like so: DATE([Isoyear],[Period],1), so I could start using time-intelligence functions.  Unfortunately this didn't work, not sure why.

 

I recall that Previousmonth-function wasn't available in the early days of PowerBI, and instead everybody used a Calculate+filter(+ALL?) function. I'm having a hard time finding this syntax, does anyone know what it was? I'd like to try this to solve my problems.

 

1 REPLY 1
amitchandak
Super User
Super User

@lockmirbee , With help from year period YYYYPP, if you can create a rank column you can work with that

 

example, new column in date table

Period Rank = RANKX(all(Period),Period[year period],,ASC,Dense)

 

Measures

This Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])))
Last Period = CALCULATE(sum('Table'[Qty]), FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])-1))

 

 

explained in

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

 

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.