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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.