cancel
Showing results for
Did you mean:
Helper II

## How to define the measure which uses the evaluation context value

MyMeasure = TotalLeaversYTD / NoOfPeople * (12 / n)

where

n is the month for which the measure is being calculated

Rest of the things I am able to create a measure however not able to figure out how to create a measure for n which can be called up for MyMeasure

1 ACCEPTED SOLUTION
Super User III

Hi,

Try this

=IF(MONTH(MIN(Data[MonthName]))-3<0,12+(MONTH(MIN(Data[MonthName]))-3),MONTH(MIN(Data[MonthName]))-3)

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
4 REPLIES 4
Solution Sage

Your post is not clear. Do you want the current month to be considered as n?

Helper II

I want the filtered month no to be considered as n

for e.g. while calculating YTD % as in May, value of n should be 5-3 = 2 (2nd from Apr)

(Financial year considered as Apr to Mar)

Helper II

My PowerBI table looks like this...I am unable to create a measure YTDAttrition which gets evaluated in context of the selected month. Please refer to the above screenshot formula next to YTDAttrition

Super User III

Hi,

Try this

=IF(MONTH(MIN(Data[MonthName]))-3<0,12+(MONTH(MIN(Data[MonthName]))-3),MONTH(MIN(Data[MonthName]))-3)

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com

Announcements

#### Manage your user group events

Check out the News & Announcements to learn more.

#### Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

#### Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

#### Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Top Kudoed Authors