Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I'm building charts for Month over Month data, but I'm having some issues getting it to work right. Below are snippets of my chart, the first is the default appearance, the second is when I select the month of March. It should show me March 2025 and Feb 2025, but it won't. Below the images is the current set analysis I have in my expressions:
Default, shows current month and previous month
When I select March, it does not show me current (selected) month and previous month
Current Year, Current Month: (works fine)
{$<Year={$(=If(GetSelectedCount(Year) > 0, Concat(DISTINCT Year, ','), year(date(today()))))},
Month={$(=If(GetSelectedCount(Month) > 0, Concat(DISTINCT Month, ','), month(date(today()))))}
Current Year, Previous Month: (Works on default, but not when filtered/selected)
{$<Year={$(=If(GetSelectedCount(Year) > 0, Concat(DISTINCT Year, ','), year(date(AddMonths(today(), -1)))))},
Month={$(=If(GetSelectedCount(Month) > 0, Concat(DISTINCT Month, ','), month(date(AddMonths(today(), -1)))))}
Any help would be greatly appreciated! Thanks in advance!!
Hi,
If we consider the loading script (I added data from Feb.) :
Description of the measure : =MonthName(Max(YourDate))
Measure for previous month (considering'previous' will be the previous tu the last selected...) :
= Sum( {1 <YourDate={">=$(=MonthStart(Max(YourDate), -1)) <=$(=MonthEnd(Max(YourDate), -1))"}>} Value)
Description of the measure :=MonthName(MonthStart(Max(YourDate),-1))
Selection made on a dimension 'Month' : =MonthName(YourDate)
Remark : I did that like this to get a quick result... but would be better to have a calendar and use a dedicated field for the month.
If you select Apr 2025 (Or make no selection) :
If you select Mar 2025 :
Let me know if this answer is helping you (if yes, please tick the answer as a solution).
Regards
Hi,
If we consider the loading script (I added data from Feb.) :
Description of the measure : =MonthName(Max(YourDate))
Measure for previous month (considering'previous' will be the previous tu the last selected...) :
= Sum( {1 <YourDate={">=$(=MonthStart(Max(YourDate), -1)) <=$(=MonthEnd(Max(YourDate), -1))"}>} Value)
Description of the measure :=MonthName(MonthStart(Max(YourDate),-1))
Selection made on a dimension 'Month' : =MonthName(YourDate)
Remark : I did that like this to get a quick result... but would be better to have a calendar and use a dedicated field for the month.
If you select Apr 2025 (Or make no selection) :
If you select Mar 2025 :
Let me know if this answer is helping you (if yes, please tick the answer as a solution).
Regards