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

Check date if its within StartDate and EndDate

Hi All,

 

I have orders with StartDate and EndDate. and i have a filter "Month Year". 

When i select a value in MonthYear Filter, for example "August 2020",  i need to check if Aug 2020 is between the startdate and the enddate and provide orders only meet this criteria. 

 

Any help in getting this please.

 

LP280388_0-1600870688886.png

 

6 REPLIES 6
VijayP
Super User
Super User

@Anonymous 

Calculate(Measure,filter(all(datestable),datesbetween(datestable[dates], min(selectedvaluue(dates[date),max(selectedvalue(dates[date])

Please try this Formula Measure and let me know




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

@VijayP  Hi Vijay,

 

Could you please elaborate more on your solution.

 

I have "month year" in a seperate table and the startdate and enddate is in one table. 

 

I need to compare if the value selected in "monthyear" is between this startdate and enddate.

Anonymous
Not applicable

Hi all,

 

I think my question is very simple, but somehow im unable to figure it out and not able to find relevant answers in powerbi forum.

 

Please please help me with this.

@Anonymous Re-reading post, you need a Complex Selector. https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M534

 

The trick is to use ALL in order to break filter context and then determine if each item is within range. It is nex to impossible to be more specific without sample data as text and expected output.

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@Anonymous Are you looking for something like LookupValue Range?

https://community.powerbi.com/t5/Quick-Measures-Gallery/LOOKUPVALUE-Range/m-p/974201#M430


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler  Thanks Greg.  

 

I need to check if the date i have selected in the filter is within the startdate and the enddate and put orderamount next to it if it matches the criteria.

 

I'm bit confused with the lookupvalue range solution that you have implemented. Would you mind explaining how i can modify to my scenario? 

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.