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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.