Forum Discussion
Using ALLEXCEPT and/or ALLSELECTED to ignore multiple active slicers except for 2 slicers/columns
That's helpful, in that case it's probably;
Sample Measure = VAR MaxDate = Max(EncounterFact[EncounterDate.EncounterDate]) VAR MinDate = Min(EncounterFact[EncounterDate.EncounterDate]) VAR _Filter = Filter(ALL(EncounterFact) ,EncounterFact[EncounterDate.EncounterDate] > MinDate && EncounterFact[EncounterDate.EncounterDate] < MaxDate &&
EncounterFact[Encounters.ProviderID] > 0
)
RETURN CALCULATE ( distinctcount( EncounterFact[Encounters.ProviderID])
, _Filter)
Hey Steve, unfortunately that didn't work either. I actually started to go down a seperate path using some variables and SWITCH. I probably should post this as a new post on the forum, but thought you might look at it and see if it works better. Below is a screenshot of the Excel spreadsheet showing 2 examples. The first example contains my sample data and slicer visuals available to select from. In the first example you can see all 3 slicers are active with a selection. The second example shows what should happen if 1 slicer is selected. I've added some notes with the examples, but I want to find the DAX that would work for BOTH the yellow ? boxes.
Here is some of the DAX that I started for the measure. Have any ideas on this to make it work? Thanks so much again for your help.
Sample Measure =
// Measure 1:
VAR ProviderID =
CALCULATE (
DISTINCTCOUNT ( EncounterFact[Encounters.ProviderID] ),
EncounterFact[Encounters.ProviderID] > 0
)
// Hierarchy levels in order of smallest (most granular) to largest:
VAR VisitTypeSelected =
ISFILTERED ( EncounterFact[Encounters.VisitType] )
VAR ChannelSelected =
ISFILTERED ( EncounterFact[ModalityRevised] )
VAR CategorySelected =
ISFILTERED ( EncounterFact[ModalityCategory] )
// Denominator measures based on slicer selection:
VAR VisitTypeTotal =
CALCULATE ( ProviderID, ALL ( EncounterFact[Encounters.VisitType] ) )
VAR ChannelTotal =
CALCULATE ( ProviderID, ALL ( EncounterFact[ModalityRevised] ) )
VAR CategoryTotal =
CALCULATE ( ProviderID, ALL ( EncounterFact ) )
RETURN
SWITCH (
TRUE (),
VisitTypeSelected, VisitTypeTotal,
ChannelSelected, ChannelTotal,
CategorySelected, CategoryTotal,
CategoryTotal
)