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

Measure to return value from column between dates

Hi, 

 

I have a table formated as : 

 

ID          StartDate               EndDate             FTE

A1          10/11/2016          30/09/2019          92
A1          01/10/2019                                      100

A2          01/01/2019          30/06/2019         100

A2          01/07/2019                                      60

 

I am trying to create a measure which will return  (it must be a measure or varible as it will be used to perfom a calculation in another measure) :

92 for ID A1 between NOV/2016 up to SEP/2019 and 100 from OUT/2019

100 for ID A2 between JAN/2019 up to JUN/2019 and 60 from JUL/2019

 

I have this table and a Calendar table, inactive interfaece. 

 

Any idea?  

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Just use SUM() instead of MAX() in the formula and you will get correct total value.

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@Anonymous , not very clear refer if this file can help

 

Anonymous
Not applicable

Hi @amitchandak , 

 

Thanks for your reply, however this file doesnt help in this case.  As I do no want quantity, I would like to get the value back. 

 

So having in mind this table: 

 

ID          StartDate               EndDate             FTE

A1          10/11/2016          30/09/2019          92
A1          01/10/2019                                      100

A2          01/01/2019          30/06/2019         100

A2          01/07/2019                                      60

 

 

So I create a measure : 

 

Correct FTE= MAX(Table [FTE]) 

 

But this measure is retuning always the biggest value and the opposite happens if i cahnge it to MIN. 

 

what I am trying to achive is to return the value of the column FTE between the date range, with no calculation. 

 

So having this tbale as axemple: 

ID A1, for any date I pick between NOV/16 and SEP/19 the return must be 92 and From OCT/19 100. 

ID A2, for any date I pick between JAN/19 and JUN/19 the return must be 100 and from JUL/19  60 . 

 

This figure is pivot to be used in another measure. 

Hi @Anonymous ,

 

Check this measure.

 

Measure = CALCULATE(MAX('Table'[FTE]),FILTER('Table','Table'[StartDate]<=SELECTEDVALUE('date'[Date])&&('Table'[EndDate]>=SELECTEDVALUE('date'[Date])||'Table'[EndDate]=BLANK())))

 

Result would be shown as below.

2.PNG

3.PNG

4.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

@v-jayw-msft this is worked when you look at line results, however the total is not totalizing. 

So in your first example the total should be 192, second example 152 and third 160. 

 

do you know how to get this ? 

Hi @Anonymous ,

 

Just use SUM() instead of MAX() in the formula and you will get correct total value.

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

thanks it worked perfectly. 

 

thanks so much. 

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.