Forum Discussion
Dynamic Last Visit based on Date Slicer
Why doesn't MAX of the date work?
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
Hi Greg,
Thanks for your reply and thanks also for pointing to a good link.
Sorry may be I didnt make it clear in the question but I want the Max Date to be used as a slicer as well.
I have a date slicer which is based on say column name = measurementdate.
To get Max Visit Date working as a slicer, I am creating 2 calculated columns as follows :
MaxVisitDate =
CALCULATE(max(Measurement[measurementdate]);FILTER(Measurement;Measurement[hkpi_accountid]=EARLIER(Measurement[hkpi_accountid])))
LastVisit = if(Measurement[MaxVisitDate]=Measurement[measurementdate];"Yes";"No")
This shows the max measurement date per account ignoring the period selected in the date slicer. How do I get it show the max measurement date within the period selected and used it as a slicer ?
Thanks !
- v-lili6-msft7 years ago
Community Support
hi, Anonymous
After my test, you could try to use ALLEXCEPT Function to add measure instead of the two columns
Measure = CALCULATE(MAX(Measurement[measurementdate]),ALLEXCEPT(Measurement,Measurement[hkpi_accountid]))
Measure 2 = IF(CALCULATE(MAX(Measurement[measurementdate]),ALLEXCEPT(Measurement,Measurement[hkpi_accountid]))=CALCULATE(MAX(Measurement[measurementdate])),"Yes","No")
Result:
Best Regards,
Lin