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.
Hello,
I am having trouble creating a measure that takes the earliest date based on a value in another column. To break it down in simpler terms, let's call the referenced column "Status" and the two possible values are "Yes" or "No", and in this case we are filtering for "Yes". The date column will be called "date".
So far, I've been successful with writing a measure that takes the earliest date column using the MIN function:
Measure1 = MIN('Table Name'[Date])
I've tried incorporating the Status = "Yes" component of the measure as well with no luck. Here are some instances I've tried:
Measure2 = MIN(FILTER('Table Name', 'Table Name'[Status] = "Yes"))
Measure3 = MIN('Table Name'[Date], FILTER 'Table Name', 'Table Name'[Status] = "Yes")
Measure4 = FILTER('Table Name', 'Table Name'[Status] = "Yes", MIN('Table Name'[Date]))
Perhaps the FILTER function isn't the way to go here. Any feedback is appreciated.
Solved! Go to Solution.
Hi @npombo ,
Please use calculate() function to wrap the filter() formula.
For example:
measure = calculate(min([date]),filter(allselected('table'),[status]="Yes"))
Best Regards,
Jay
Hi Jay, this worked! Thank you for assisting me.
Hi @npombo ,
Please use calculate() function to wrap the filter() formula.
For example:
measure = calculate(min([date]),filter(allselected('table'),[status]="Yes"))
Best Regards,
Jay
@npombo , try like
Measure2 = MINX(FILTER(allselected('Table Name'), 'Table Name'[Status] = "Yes"), 'Table Name'[Date])
orr
Measure2 = MINX(FILTER(('Table Name'), 'Table Name'[Status] = "Yes"), 'Table Name'[Date])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
37 | |
25 | |
19 | |
14 | |
8 |
User | Count |
---|---|
69 | |
48 | |
44 | |
19 | |
15 |