Forum Discussion
Display Card with date range from selected slicer
- 3 years ago
JoeCrozier Oh, for that I would just use this:
Measure = VAR __MaxStatus = MAX('Staff'[Status Date]) VAR __MinStatus = MIN('Staff'[Status Date]) RETURN __MinStatus & " - " & __MaxStatus
JoeCrozier So let's say you have a single table, you could do this:
Measure =
VAR __MaxStatus = MAX('Table'[Status Date])
VAR __MinStatus = MIN('Table'[Status Date])
VAR __MaxBlue = MAX('Table'[Blue 'Planned' Visit Date])
VAR __MinBlue = MIN('Table'[Blue 'Planned' Visit Date])
VAR __Table =
FILTER(
'Table',
( [Status Date] >= __MinStatus && [Status Date] <= __MaxStatus ) &&
( [Blue 'Planned' Visit Date] >= __MinBlue && [Blue 'Planned' Visit Date] <= __MaxBlue )
)
RETURN
SUMX(__Table,[Value])
Use that in your Card visual. That said, if it is really a single table then it should already filter the cards and you could simply do this:
Measure = SUM('Table'[Value])
or
Measure = SUMX('Table',[Value])
The last Measure has the advantage that you could do a CONCATENATEX for example if you want to return multiple values (because multiple rows are in context).
- JoeCrozier3 years ago
Helper II
Greg_Deckler Thank you! So just to make sure I understand, lets say I have this selected in the slicer on the first page:
And I create a measure that looks like this:
And I put that measure on this card:
I would expect/hope for that card to say:
"4/18/2010 - 8/20/2018"
But it doesn't. Clearly I'm doing something wrong or didn't communicate it well. Can you spot what I did?
- Greg_Deckler3 years ago
Community Champion
JoeCrozier Oh, for that I would just use this:
Measure = VAR __MaxStatus = MAX('Staff'[Status Date]) VAR __MinStatus = MIN('Staff'[Status Date]) RETURN __MinStatus & " - " & __MaxStatus- JoeCrozier3 years ago
Helper II
Im sorry to keep drawing you back in (and I really really appreciate all the help!) but it still seems to not be working:
Any ideas?