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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
ROG
Responsive Resident
Responsive Resident

Measure using another measure minus previous date.

Hi all,

I would like to add another column the table below that show me the 'Opening Base'.
I know that the  'Opening Base' is sum(active_customers) from fsubscriber_table on the last day of the previous month.
Basically on the table below, the Active Customers value 733,719 from the 31st of Jan 2022 should be the value of the 'Opening Base' on the 1st of Feb 2022.
I'm struggling to get this logic in a measure. 

ROG_0-1658250214851.png

Many thanks.

1 ACCEPTED SOLUTION
ROG
Responsive Resident
Responsive Resident

Hey, that works! Thank you.

View solution in original post

2 REPLIES 2
vapid128
Solution Specialist
Solution Specialist

add colnum:

YYMM = YEAR([date])*12+MONTH([date])
 
Measure 2 =
var _lastDate = CALCULATE(MAX([date]),FILTER(ALL(table22), table22[YYMM]= MAX(table22[YYMM])-1))
return CALCULATE([Measure],FILTER(ALL(table22),table22[date]=_lastDate))
 
Measure 3 =
IF(DAY( MIN(table22[date]))=1,
[Measure 2],
[Measure]
)
ROG
Responsive Resident
Responsive Resident

Hey, that works! Thank you.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.