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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
AarthySivaramak
Frequent Visitor

Calculate difference from Previous month dates in Power BI

Hello,

Am looking for some help to understand how to calculate the previous month difference from the data set below:  

For 3/1/2024  Prev Mth Diff but from 4/1/2024 the previous month difference is calculated based on the Net cost from previous month. I tried different DAX formulas and it resulted in 0 as the value for "Prev Mnth Diff". Need help!!

Thanks in advance.

AarthySivaramak_0-1739913490587.png

 

5 REPLIES 5
AarthySivaramak
Frequent Visitor

 

 

 3/1/2024 4/1/2024 5/1/2024 6/1/2024  
 Net CostPrev Mth DiffNet CostPrev Mth DiffNet CostPrev Mth DiffNet CostPrev Mth Diff 
REPORT         
TEST1$298 $301$3$301$0$200$101 

Thank you all for your response. But I think , I should be more specific on my question. I need the diff in cost from the current as well as previous month. Please find the sample data below: I have only NET COST and month field in my report and i need to figure the previous month diff from the date provided. 

For some reason, it doesn't allow me to paste the sample data along with replies. so am sending them separately.

My example shows how to get the previous months' value of Total Revenue. You can just get the difference between Total Revenue and the previous month's Total Revenue.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
danextian
Super User
Super User

Hi @AarthySivaramak 

 

Make sure you're using a separate dates table that's been marked as such https://www.sqlbi.com/articles/mark-as-date-table/ 

Create this measure:

Total Revenue Prev Month =
CALCULATE ( [Total Revenue], PREVIOUSMONTH ( Dates[Date] ) )

danextian_0-1739934668626.png

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors
Top Kudoed Authors