Forum Discussion
wherdzik
Helper III
2 years agoTwo time Frames on Same Graph
Hi built this dashboard and the user wants two differnet time frames. So when I pick the month some of the statistics that that have a YTD prefacing it. They have to be on a YTD basis so If I select...
wherdzik
Helper III
2 years agoI created a Calendar Table. But I still do not know how to get the YTD amount in there. I am struggling quite a bit to get this to work.
I tried to use chatGPT now that I have this table but its still not working.
AverageVisitsPerDoctorForSelectedMonthOrYTD =
VAR SelectedMonthEnd = EOMONTH(MAX('Calendar'[Date]), 0)
VAR YearStart = STARTOFYEAR('Calendar'[Date])
VAR ProviderFilter = ALLSELECTED('SEP YTD'[Provider])
VAR TotalPatients =
CALCULATE(
DISTINCTCOUNT('SEP YTD'[Patient Name]),
ProviderFilter,
'SEP YTD'[Service Date] >= YearStart && 'SEP YTD'[Service Date] <= SelectedMonthEnd
)
VAR TotalServiceDays =
CALCULATE(
DISTINCTCOUNT('SEP YTD'[Service Date]),
ProviderFilter,
'SEP YTD'[Service Date] >= YearStart && 'SEP YTD'[Service Date] <= SelectedMonthEnd
)
RETURN
IF(
TotalServiceDays > 0,
DIVIDE(TotalPatients, TotalServiceDays),
BLANK()
)
For example when I select January in the filter I should expect the Month output and the YTD output be the same.
Sorry I am just so new at this that I am struggling pretty badly.
This is my date table.