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