Forum Discussion
Return Value Based on Date Criteria
I am trying to build a measure that returns a value based on a data criteria i.e. date <= date
Sample:
| Entity | Version | Value | Date |
| A | A | 10 | 05/2021 |
| A | A | 10 | 06/2021 |
| A | A | 10 | 07/2021 |
| A | B | 15 | 07/2021 |
Output example if criteria is Date < 07/2021 then Version A else Version B
| Entity | 05/2021 | 06/2021 | 07/2021 |
| A | 10 | 10 | 15 |
7 Replies
- parry2kSuper User
rstover_atx not fully clear what you want what is date <= date? what dates you are referring here? Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490- rstover_atxFrequent Visitor
when the date field from the table is < some measure defined date (let's say 7/1/2021)
- parry2kSuper User
rstover_atx how you are defining the date?
- rstover_atxFrequent Visitor
IF ( table [ date ] < date (2021,6,1)
- parry2kSuper User
rstover_atx hmmm, you are not using a fixed date? Not sure I can help with this since it is very hard to understand the basics of your requirement. I hope someone else can help.
- rstover_atxFrequent Visitor
Does the example output table not help?
- AnonymousNot applicable
Hi rstover_atx ,
Sorry, your example really makes me a little bit confused. It is best to give your original sample data, and then give the expected result.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.