Forum Discussion
SiroPW
Helper I
7 years agoMax & Min Dates Only Filter (top1/bottom1)
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...
- 7 years ago
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.
v-diye-msft
Community Support
7 years agoHi 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:
SiroPW
Helper I
7 years agoThanks, 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:
MAX&MIN =
var maxd = MAXX(ALLSELECTED(portfolio_eom),[as_at_date])
var mind = MINX(ALLSELECTED(portfolio_eom),[as_at_date])
Return IF(MAX(portfolio_eom[as_at_date])=maxd,"Yes","No")
I can see the maxd is returning the correct date and MAX(portfolio_valuation_eom[as_at_date]) by itself is too (they match), however every record returns "Yes".
Any ideas why? I feel like it should be something simple I'm missing. Thanks
- SiroPW7 years ago
Helper I
I think the problem is the ALLSELECTED is not working my my Date slicer.
- v-diye-msft7 years ago
Community Support
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.