Forum Discussion
rmcgrath
1 year agoAdvocate II
X-Axis format
I have the following line chart where the X-Axis is controlled by a Parameter (Age or Weeks). What I would like to happen is if Weeks is selected, then it displays 1 full year (depending on which ye...
- Anonymous1 year ago
Hi rmcgrath ,
Try the following expression:
FilteredWeeks = VAR SelectedYear = SELECTEDVALUE('Year'[Year]) VAR SelectedParameter = SELECTEDVALUE('Parameter'[Parameter]) RETURN IF( SelectedParameter = "Weeks", CALCULATE( SUM('YourTable'[Value]), FILTER( 'YourTable', YEAR('YourTable'[Date]) = SelectedYear ) ), SUM('YourTable'[Value]) )Hope it helps!
Best regards,
Community Support Team_ Scott ChangIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
1 year agoNot applicable
Hi rmcgrath ,
Try the following expression:
FilteredWeeks =
VAR SelectedYear = SELECTEDVALUE('Year'[Year])
VAR SelectedParameter = SELECTEDVALUE('Parameter'[Parameter])
RETURN
IF(
SelectedParameter = "Weeks",
CALCULATE(
SUM('YourTable'[Value]),
FILTER(
'YourTable',
YEAR('YourTable'[Date]) = SelectedYear
)
),
SUM('YourTable'[Value])
)
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.