Forum Discussion
Remove visual filter context
- 10 months ago
FADAVI Here an updated PBIX, in the previous there was a bug.
If it fix your problem, please accept this answear as a solution!
BBF
💡 Did I answer your question? Mark my post as a solution!
👍 Kudos are appreciated
🔥 Proud to be a Super User!
FADAVI Hi!
Try with:
RedCard_Value :=
VAR MinSlicer =
CALCULATE(
MIN('Table'[Date]),
REMOVEFILTERS('Table'[Date]) -- ignore table click, keep slicer
)
VAR ClickedOrMax =
IF(
HASONEVALUE('Table'[Date]),
SELECTEDVALUE('Table'[Date]), -- clicked value
CALCULATE(MAX('Table'[Date])) -- max from slicer
)
RETURN
ClickedOrMax
BBF
💡 Did I answer your question? Mark my post as a solution!
👍 Kudos are appreciated
🔥 Proud to be a Super User!
Thanks for your answer. It will not show the min value of the slicer. It will show the min value of the whole date column.
In my example I set the slicer value from 01/01/2025 to 31/12/2025. Your measure will show the first of january of 2024 instead of 2025
- BeaBF10 months agoSuper User
FADAVI Retry with:
RedCard_Value :=
VAR MinSlicer =
CALCULATE(
MIN('Table'[Date]),
ALLSELECTED('Table'[Date]) // keep slicer, ignore table click
)
VAR Clicked =
SELECTEDVALUE('Table'[Date])
RETURN
IF(
HASONEVALUE('Table'[Date]),
Clicked, // when user clicks in table
MinSlicer // when nothing clicked
)BBF
💡 Did I answer your question? Mark my post as a solution!
👍 Kudos are appreciated
🔥 Proud to be a Super User!
- FADAVI10 months agoFrequent VisitorVAR Clicked =SELECTEDVALUE('calendar'[Date])Will not give me the min but the actual clicked valueAnd your first var is the one I originnaly usedCALCULATE(MIN('calendar'[date]),ALLSELECTED('calendar'[date]))
- BeaBF10 months agoSuper User
FADAVI So I don't know if I undestood your request, can you better explain it?
RedCard_Value :=
VAR SlicerRange =
CALCULATETABLE(
VALUES('calendar'[Date]),
ALLSELECTED('calendar'[Date])
)
VAR MinSlicer =
CALCULATE(
MIN('calendar'[Date]),
REMOVEFILTERS('calendar'[Date]),
KEEPFILTERS(TREATAS(SlicerRange, 'calendar'[Date]))
)
VAR ClickedValue =
SELECTEDVALUE('calendar'[Date])
RETURN
IF(
HASONEVALUE('calendar'[Date]),
ClickedValue, -- When a table value is clicked
MinSlicer -- When nothing is clicked
)BBF
💡 Did I answer your question? Mark my post as a solution!
👍 Kudos are appreciated
🔥 Proud to be a Super User!