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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
Memorable Member
Memorable Member

@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
Memorable Member
Memorable Member

@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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.