Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
HI,
I have a dataset like follows:
| Date | Value |
| 2019/08/01 | 10 |
| 2019/08/01 | 20 |
| 2019/08/01 | 30 |
| 2019/08/01 | 40 |
| 2019/08/01 | 50 |
| 2019/07/01 | 100 |
| 2019/07/01 | 200 |
| 2019/07/01 | 300 |
| 2019/06/01 | 1 |
| 2019/06/01 | 2 |
| 2019/06/01 | 3 |
| 2019/06/01 | 4 |
| 2019/05/01 | 1000 |
| 2019/05/01 | 2000 |
What I would like to do is be able to filter on the max and minimum dates so the result would be:
| Date | Value |
| 2019/08/01 | 10 |
| 2019/08/01 | 20 |
| 2019/08/01 | 30 |
| 2019/08/01 | 40 |
| 2019/08/01 | 50 |
| 2019/05/01 | 1000 |
| 2019/05/01 | 2000 |
I could achieve the same effect by manually ticking the 'Date' basic filter but I would have to change it every time the dataset updates. Similarly I could do topN filters for top and bottom dates but can't apply both at the same time AFAIK.
Any help is appeciated, thanks.
Solved! Go to Solution.
Hi @SiroPW ,
The formula in your measure is missing another condition:
Return IF(MAX('Table'[Date])=maxd||MAX('Table'[Date])=mind,"Yes","No")
I attached my pbix here for your reference, also please share yours if you are still stuck in it.
i would use a calculated colunm to check if the date is equal to the max or min date and then filter on this colunm
example colunm below
Proud to be a Super User!
Thanks for the reply.
Do you know how I could modify this to work with only the filtered/selected values?
I tried ALLSELECTED like below but I'm getting an error "The MAX function only accepts a column reference as an argument".
-- first get the max date as a veriable
Hi @SiroPW ,
You can take try of this one:
MAX&MIN = var maxd = MAXX(ALLSELECTED('Table'),[Date])
var mind = MINX(ALLSELECTED('Table'),[Date])
Return IF(MAX('Table'[Date])=maxd||MAX('Table'[Date])=mind,1,0)
When the date were filtered, it still works:
Thanks, I've tried a lot of combinations/tweaks of your answer but I still can't quite get it to filter properly.
It basically ends up returning True/1 for every record.
My latest attempt was to strip it back:
Hi @SiroPW ,
The formula in your measure is missing another condition:
Return IF(MAX('Table'[Date])=maxd||MAX('Table'[Date])=mind,"Yes","No")
I attached my pbix here for your reference, also please share yours if you are still stuck in it.
I think the problem is the ALLSELECTED is not working my my Date slicer.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 20 | |
| 18 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 50 | |
| 38 | |
| 31 | |
| 27 |