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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rosscortb
Post Patron
Post Patron

Apply previous month to Difference from Filtered Value Quick Measure

Hi, I am trying to count the previous month headcount after filtering out the "babcock - weekly" in the Payroll Area column. I can get this on current month but where do I apply the previous month? Thanks Ross Count of Payroll Area difference from Babcock - Weekly 2 = VAR __BASELINE_VALUE = CALCULATE( COUNTA('DB Headcount'[Payroll Area]), 'DB Headcount'[Payroll Area] IN { "Babcock - Weekly" } ) VAR __MEASURE_VALUE = COUNTA('DB Headcount'[Payroll Area]) RETURN IF(NOT ISBLANK(__MEASURE_VALUE), __MEASURE_VALUE - __BASELINE_VALUE)
1 ACCEPTED SOLUTION

@rosscortb

 

I can't see your sample data, so maybe my answer is not correct.

 

You can try below coding to see if you can count last month's amount.

 

VAR maxdate= max('date')

VAR lastmont=edate(maxdate,-1)

CCOUNTROWS(FILTER('DB Headcount',date=lastmonth && 'DB Headcount'[Payroll Area] <> "Babcock - Weekly"))





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
rosscortb
Post Patron
Post Patron

Or can add I Previous Month to this, Measure = COUNTROWS(FILTER('DB Headcount','DB Headcount'[Payroll Area] <> "Babcock - Weekly"))

@rosscortb

 

I can't see your sample data, so maybe my answer is not correct.

 

You can try below coding to see if you can count last month's amount.

 

VAR maxdate= max('date')

VAR lastmont=edate(maxdate,-1)

CCOUNTROWS(FILTER('DB Headcount',date=lastmonth && 'DB Headcount'[Payroll Area] <> "Babcock - Weekly"))





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hello

 

I managed to get this to work(sort of)

 

Meausure 4 = COUNTROWS(FILTER('DB Headcount','DB Headcount'[Payroll Area] <> "Babcock - Weekly" && PREVIOUSMONTH('Month'[Date])))
 
My figures started last April(I've no figures for this year yet just april - dec 2018) and the measure returns the value of number of rows minus april, so its not looking at the last month but at everything but the first month of my data which is april.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors