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
PowerStone
New Member

Measure for start of month value to equal previous month ending value

Hello, 
 
I'm having some trouble with what should be an easy measure to make the beginning month QTY equal the previous month ending QTY.  I've tried a bunch of different ways and the QTY I'm returning is always the current month value, not the previous month. 
 
Here's some sample data:
DateYearMonth NumMonthBegin AMTBegin AMT 2Begin AMT 3QTY SoldQTY ReceivedQTY IssuedQTY TransferQTY AdjustedEnd Amt
1/1/201620161Jan5,3115,3115,311-1,3823,936 -4253,1825,311
2/1/201620162Feb-2,353-2,353-2,353-1,379  -974 -2,353
3/1/201620163Mar3,2423,2423,242-1,5584,800 -4824823,242
4/1/201620164Apr-2,762-2,762-2,762-1,293  -605-864-2,762
5/1/201620165May17,60417,60417,604-2,0107,200 -1,20713,62117,604
6/1/201620166Jun-3,244-3,244-3,244-2,020  -1,224 -3,244
 
The beginning QTY for February should be 5,311 and instead I'm pulling in the current month end QTY.  
 
Here are the 3 measures I'm using:
 
Begin AMT = CALCULATE([End Amount],PREVIOUSMONTH(tblCALENDAR[Date]))
 
Begin AMT 2 = CALCULATE([End Amount], DATEADD(tblCALENDAR[Date], -1, MONTH))
 
Begin AMT 3 = 
VAR DaysInterv = DATEDIFF(MIN(tblCALENDAR[Date]),MAX(tblCALENDAR[Date]),DAY)
RETURN
CALCULATE([End Amount],DATESINPERIOD(tblCALENDAR[Date],MIN(tblCALENDAR[Date]) - 1,DaysInterv,MONTH))
 
Any help would be greatly appreciated.  Thanks!
1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@PowerStone 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.