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
Anonymous
Not applicable

I want to show all open orders from previous month in a dashboard matrix

Hello,

 

I am new to Power BI. I have a table with below columne

  • Customer
  • Date: (month-year)
  • Open Orders
  • Fulfilled Orders

I want to create a matrix in my dashboard to show the open orders for each customer for previous month

so in Feb, I want to only show open orders from Jan for that customer

CustomerMonthOpen OrdersFulfilled Orders
AJan-2003
AFeb-2035
AMar-20210
AApr-20510
BJan-2005
BFeb-2046
BMar-20810
BApr-202080

So for March I want to show below matrix

 

CustomerFeb-20
A3
B4

 

Is it possible?

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

You could use time intelligence function PREVIOUSMONTH or DATEADD to get it easily.

https://docs.microsoft.com/en-us/dax/previousmonth-function-dax

https://docs.microsoft.com/en-us/dax/dateadd-function-dax

and 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 :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

PREVIOUS MONTH Data = CALCULATE(SUM('Table'[Open Orders]),PREVIOUSMONTH('Date'[Date]))
PREVIOUS MONTH Data 2 = CALCULATE(SUM('Table'[Open Orders]),DATEADD('Date'[Date],-1,MONTH))

Result:

3.JPG

and here is sample pbix file, please try it.

 

Regards,

Lin

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

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

 prefer using datesmtd and totalmtd with date calendar. Make sure you have date calendar

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)),
Date[Date]<date(year(today()),month(today())-1,day(today())))

last MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
last year MTD Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))

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 :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

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
Tahreem24
Super User
Super User

@Anonymous ,

 

You can try below DAX measure to get your expected result:

Prev_Month_Open_Order = CALCULATE(sum('Table'[OpenOrder]),PREVIOUSMONTH('Table'[DateColumn]))
But, make sure that you have proper date column in Date format to get the expected result.
 
Don't forget to give thumbs up 👍 and accept this as a solution if it helped you.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

You could use time intelligence function PREVIOUSMONTH or DATEADD to get it easily.

https://docs.microsoft.com/en-us/dax/previousmonth-function-dax

https://docs.microsoft.com/en-us/dax/dateadd-function-dax

and 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 :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

PREVIOUS MONTH Data = CALCULATE(SUM('Table'[Open Orders]),PREVIOUSMONTH('Date'[Date]))
PREVIOUS MONTH Data 2 = CALCULATE(SUM('Table'[Open Orders]),DATEADD('Date'[Date],-1,MONTH))

Result:

3.JPG

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

So, generally you would use PREVIOUSMONTH for that. But, if the time intelligence functions vex you, See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I will check it out, thanks Greg

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.