
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sum if less than variable value
Dear community, I'm trying to make a sum of numbers based on the year being less or equal to a variable.
I tried both these set expressions:
Sum({<[Reporting Date.autoCalendar.Year] ={"<=$(=vCurrentYear)"}>} Actuals)
and
Sum({<[Reporting Date.autoCalendar.Year]={"<=$(=$(vCurrentYear))"}>} Actuals)
For some reason, neither expression is showing any data.
Anybody any ideas please.
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@PLE Your measure looks fine. What is the expression of vCurrentYear variable? Make sure that your variable expression works and giving year value. Seems like your variable expression evaluating NULL value which is causing this issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I thought about that, but the formula bar below the editor shows clearly {"<=2021"}
So I consider the variable correct.
When I take the variable in a KPI chart, it shows current year 2021.
When I use the formula with "=" instead of "<=" it works fine as well.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Kushal_Chawda , I solved the problem for now.
I defined a Year(Reporting Date) in my load script rather than using the autocalendar.
The formula works perfect when using this field instead of the autocalendar.year field.
