Forum Discussion
ahiemstra
1 year agoHelper I
Measure incorporating slicer value
I'm attaching a PBIX file and hoping someone might be able to assist. I've created two separate measures: Avg Encounters/Day Discipline and Avg Encounters/Day Provider. The calculation for both me...
- 1 year ago
I spent some more time working on the DAX and was able to adjust the part in the denominator that wasn't calculating correctly, and now it's working as expected.
Anonymous
1 year agoNot applicable
Hi ahiemstra hello Greg_Deckler, thank you for your prompt reply!
Try the following measures to meet your requirements:
Avg Encounters/Day Discipline2 =
VAR TotalEncounters = CALCULATE(
COUNT('1 ON 1'[Encounter Time]),
'1 ON 1'[Activity Description] = SELECTEDVALUE('1 ON 1'[Activity Description]),REMOVEFILTERS('1 ON 1'[Employee Full Name]))
VAR TotalDays = CALCULATE(
DISTINCTCOUNT('1 ON 1'[Encounter Date]),
'1 ON 1'[Activity Description] = SELECTEDVALUE('1 ON 1'[Activity Description]),
REMOVEFILTERS('1 ON 1'[Employee Full Name])
)
RETURN
DIVIDE(TotalEncounters, TotalDays, 0)
Avg Encounters/Day Provider2 =
VAR TotalEncounters = CALCULATE(
COUNT('1 ON 1'[Encounter Time]),
'1 ON 1'[Employee Full Name] = SELECTEDVALUE('1 ON 1'[Employee Full Name]),
REMOVEFILTERS('1 ON 1'[Activity Description])
)
VAR TotalDays = CALCULATE(
DISTINCTCOUNT('1 ON 1'[Encounter Date]),
'1 ON 1'[Employee Full Name] = SELECTEDVALUE('1 ON 1'[Employee Full Name]),
REMOVEFILTERS('1 ON 1'[Activity Description])
)
RETURN
DIVIDE(TotalEncounters, TotalDays, 0)
Result for your reference:
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ahiemstra
1 year agoHelper I
I spent some more time working on the DAX and was able to adjust the part in the denominator that wasn't calculating correctly, and now it's working as expected.