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
Penn
Resolver I
Resolver I

How to write this measure in DAX?

Hi all,

 

I have a table [Opportunity History] that looks like this and I have independent date table 'Calendar'. How do I create a measure that return the last stage at each month end (with a month slicer). 

Annotation 2019-09-11 105357.jpg

 

The desire result will be

1. If I select Feb 2017 in the slicer, return

1.jpg

 

2. If I select Dec 2017 in the slicer, return Quotation

2.jpg

 

3. If I select Mar 2018 in the slicer, return Lost - Abandoned

3.jpg

 

The measure that I wrote doesn't work

Stage EOM = CALCULATE(MAX([Stage]), FILTER('Opportunity History', 'Opportunity History'[Date Time] <= MAX('Calendar'[This Month End])))

Thanks!

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

Stage EOM = CALCULATE(MAX([Stage]), FILTER(all('Opportunity History'), 'Opportunity History'[Date Time] <= MAX('Calendar'[This Month End])))

 

Try All. Also I think it should be = not <=

Anonymous
Not applicable

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.