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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MONA4980
Frequent Visitor

LAST MONTHS SALES

Hello, 

I am really new to Power BI and DAX. I am trying to get MOM data and have to first get my profit from last month. 

Before I throw it out there know that I have a table that uses the calendar table and I have to use DAX to create that relationship. that is the first part of the function. When I add the second part it does not return any values. the dispdate is a short date format.

No errors but no results either.

What am I getting wrong?

LAST MONTH PROFIT = CALCULATE(SUM('ORDERS'[PROFIT]),USERELATIONSHIP('Calendar'[Date],'ORDERS'[DISPDATE]), PARALLELPERIOD('ORDERS'[DISPDATE], -1, MONTH))

 

1 ACCEPTED SOLUTION
MasonMA
Community Champion
Community Champion

@MONA4980 

 

Hi, 

1. Mark your calendar table as Date table. 
2. Use time-based functions like 'PARALLELPERIOD' on your Calendar table.

 

That said, update your Measure to, 

 

LAST MONTH PROFIT =
CALCULATE(
SUM('ORDERS'[PROFIT]),
USERELATIONSHIP('Calendar'[Date], 'ORDERS'[DISPDATE]),
PARALLELPERIOD('Calendar'[Date], -1, MONTH)
)

 

Hope this works for you:) 

View solution in original post

4 REPLIES 4
v-sdhruv
Community Support
Community Support

Hi @MONA4980 ,

Just wanted to check if you were able to resolve the issue?
If you need any help, feel free to reach out.
Thanks @MasonMA  and @Greg_Deckler  for your inputs.

MasonMA
Community Champion
Community Champion

@MONA4980 

 

Hi, 

1. Mark your calendar table as Date table. 
2. Use time-based functions like 'PARALLELPERIOD' on your Calendar table.

 

That said, update your Measure to, 

 

LAST MONTH PROFIT =
CALCULATE(
SUM('ORDERS'[PROFIT]),
USERELATIONSHIP('Calendar'[Date], 'ORDERS'[DISPDATE]),
PARALLELPERIOD('Calendar'[Date], -1, MONTH)
)

 

Hope this works for you:) 

MONA4980
Frequent Visitor

Thank you for the quick reply. I clicked on your first link, time inteligence, and it did not work.

I will check out the "hard way"

Greg_Deckler
Community Champion
Community Champion

@MONA4980 You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, 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...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.