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 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!
- 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!
- FADAVI10 months agoFrequent Visitor
Ok let's explain it another way.
I want all the dates in the range set in the slicer.
I want when I click in the table to be able to have a range from the start of the slicer to the clicked value in the table, for another visual that used both of these values.
So I want MIN to be always the same and MAX to be either the one in the slicer or if I click on a value the selected value.
I want my MIN value to keep being the first value of the slicer it means removing the visual filter context when I click on value- BeaBF10 months agoSuper User
FADAVI ok, try with:
Min_Slicer_Date :=
VAR SlicerRange =
CALCULATETABLE(
VALUES('Calendar'[Date]),
ALLSELECTED('Calendar'[Date]) // gets only the slicer range
)
VAR MinSlicer =
CALCULATE(
MIN('Calendar'[Date]),
REMOVEFILTERS('Calendar'[Date]), // remove visual filters (table click)
KEEPFILTERS(TREATAS(SlicerRange, 'Calendar'[Date])) // reapply slicer range
)
RETURN
MinSlicerBBF
💡 Did I answer your question? Mark my post as a solution!
👍 Kudos are appreciated
🔥 Proud to be a Super User!