Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Experts
Based on the sample data in the PBIX...
I cannot get my previous value calculate column measure to work and return the expected result as shown in the image below
Measure
Current Row = RANKX( ALL('Table'), 'Table'[month], , ASC, Dense)Previous Row =
VAR CurrentRow = 'Table'[Current Row]
VAR PreviousRow = CALCULATE(
MAX('Table'[Current Row]),
ALL('Table'),
'Table'[family] = EARLIER('Table'[family]),
'Table'[DDate] < EARLIER('Table'[DDate])
)
RETURN IF( PreviousRow <> BLANK(), PreviousRow, CurrentRow )Previous Quantity =
CALCULATE(
MAX('Table'[qty]),
ALL('Table'),
'Table'[family] = EARLIER('Table'[family]),
'Table'[Current Row] = EARLIER('Table'[Previous Row])
)
Solved! Go to Solution.
@Anonymous , if you need a new column
previous Qty =
var _max = maxx(filter(Table, Table[family] = earlier([Family]) && [Date] < earlier([Date])), [Date])
return
maxx(filter(Table, Table[family] = earlier([Family]) && [Date] =_max ), [qty])
For measure join date with the date table and try TI
examples
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
@Anonymous , if you need a new column
previous Qty =
var _max = maxx(filter(Table, Table[family] = earlier([Family]) && [Date] < earlier([Date])), [Date])
return
maxx(filter(Table, Table[family] = earlier([Family]) && [Date] =_max ), [qty])
For measure join date with the date table and try TI
examples
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 169 | |
| 109 | |
| 91 | |
| 55 | |
| 44 |