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
Anonymous
Not applicable

Retrieve month when a measure value is bigger then another measure value

Hi all,

 

For a project I want to show the following. 

 

I have a table showing per month where we should have been (baseline %) and where we are (Actual %), these two values are calculated with measures. What I want to show is which month the Actual % complete is on the baseline %. In other words, which is the month the latest actual % is bigger than the Baseline %.

 

In the example table below, the latest actual % complete is 86% for May 2020 (latest update), and the 'first time' this is bigger than the baseline is in January 2020. So the desired outcome is January 2020. This i can use to give a delay indication (4 months), without the need to dive into the underlying schedule.

 

As both Baseline % and Actual % are measures, I would like to have a measure which is capable of achieving this. 

 

YearMonthBaseline %Actual %Desired Outcome
2019November7867 
2019December8373 
2020January8776 
2020February9182 
2020March9484 
2020April9685 
2020May9786January 2020
2020June98  

 

If anyone can help me, this would greatly help me. Thanky you  

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , You need to have month year in your table

New Measure = maxx(filter(summarize(Table,Table[Month year],"_1",[Baseline %],"_2",[Actual %]),[_1]>[_2]),[Month year])

 

If you expect more than one month , plot this measure with Month Year, In such case you can use countx in place of maxx, if needed

Anonymous
Not applicable

Hi Amtichandak,

 

Thank you for your quick reply! 

 

I've used your suggestion and added a month year to my date table:

 

Using your measure :

ESValue = MAXX(filter(summarize('Date','Date'[Month-Year],"_1",[% Baseline Complete],"_2",[% Actual Complete]),[_1]>[_2]),'Date'[Month-Year]) i get the following result:
Month-YearBaselineActualCurrent resultDesired Result
11-2019786711-2019 
12-20198373  
1-202087761-2020 
2-20209182  
3-202094843-2020 
4-202096854-2020 
5-202097865-20201-2020
6-202098   
 
So I can retrieve the date, but not the correct one. 
 

@Anonymous , Try like with month year in YYYYMM format

New column

Month-Year = format([Date],"YYYYMM")

 

Measure =
var _max =maxx(filter(summarize(Date,Date[Month-Year],"_1"[% Actual Complete]),not(isblank()),Date[Month-Year])
Var _min = minx(filter(summarize(Date,Date[Month-Year],"_1",[Baseline]),[_1]>=_max),[Month-year])
return
_min

 

if answer is correct get the month name in return

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.