Forum Discussion
Diabetic
1 year agoNew Member
Chart Granularity
I have a graph that shows the Offered, Answered & Abandoned calls from my data set. I have this on the y-axis of a bar chart and then I have created a parameter for the dates on the x-axis. This allo...
- 1 year ago
You can try creating a measure which you would use in the filter pane, set to only show when the value is 1.
Filter Measure = VAR FirstVisibleDate = MIN ( 'Date'[Date] ) VAR LastVisibleDate = MAX ( 'Date'[Date] ) VAR LastDateToShow = TODAY () VAR __SelectedGranularity = SELECTCOLUMNS ( SUMMARIZE ( Parameter, Parameter[Parameter], Parameter[Parameter Fields] ), Parameter[Parameter] ) VAR FirstDateToShow = IF ( COUNTROWS ( __SelectedGranularity ) = 1, SWITCH ( __SelectedValue, "Daily", LastDateToShow - 30, "Monthly", EOMONTH ( LastDateToShow, -13 ) + 1, "Weekly", LOOKUPVALUE ( 'Date'[Week commencing], 'Date'[Date], LastDateToShow - 7 * 8 ) ) ) VAR Result = IF ( FirstVisibleDate >= FirstDateToShow && LastVisibleDate <= LastDateToShow, 1 ) RETURN Result
johnt75
1 year agoSuper User
You can try creating a measure which you would use in the filter pane, set to only show when the value is 1.
Filter Measure =
VAR FirstVisibleDate =
MIN ( 'Date'[Date] )
VAR LastVisibleDate =
MAX ( 'Date'[Date] )
VAR LastDateToShow =
TODAY ()
VAR __SelectedGranularity =
SELECTCOLUMNS (
SUMMARIZE ( Parameter, Parameter[Parameter], Parameter[Parameter Fields] ),
Parameter[Parameter]
)
VAR FirstDateToShow =
IF (
COUNTROWS ( __SelectedGranularity ) = 1,
SWITCH (
__SelectedValue,
"Daily", LastDateToShow - 30,
"Monthly", EOMONTH ( LastDateToShow, -13 ) + 1,
"Weekly",
LOOKUPVALUE ( 'Date'[Week commencing], 'Date'[Date], LastDateToShow - 7 * 8 )
)
)
VAR Result =
IF (
FirstVisibleDate >= FirstDateToShow
&& LastVisibleDate <= LastDateToShow,
1
)
RETURN
Result
Diabetic
1 year agoNew Member
Excellent, that worked brilliantly. Thank you