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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
karlosdsouza
Helper II
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

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
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

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

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)

Capture3.JPG

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

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
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.