Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Please help with this requirement.=, this needs to be done in UI not at Modeling side
Year Amt 2020 100 2021 200 2022 300 2023 400 2024 500 2025 600 2026 700 2027 800
NOTE we need to represent year>current years means 2026, 2027 as 2026(next), 2027(Next) on bar chart
Requirement - create a Bar chart with year as dim and measure as sum of Amt
Case 1 No year selected show current year -2 to Current year +2 (2023,2024,2025,2026,2027)
Case2 If current year selected show current, and next two year (2025, 2026, 2027)
Case 3 If except current year any other selected show only that year.
Create Variable:
vCurrentYear=Year(now())
In a bar ,use this expression:
If(
GetSelectedCount(Year) = 0,
Sum({
<Year={">=$(=AddYears($(vCurrentYear), -2))<=$(=AddYears($(vCurrentYear), 2))"}>
} Amt),
If(
GetFieldSelections(Year) = '$(vCurrentYear)',
Sum({
<Year={">=$(=$(vCurrentYear))<=$(=$(vCurrentYear)+2)"}>
} Amt),
Sum({
<Year={"=$(=Only(Year))"}>
} Amt)
)
)