Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
First, I have a selection "YEAR" and another "MONTH".
I have a bar graph with months in dimension.
If there is no selection, I would like the chart to show the months of the current year but the months must be less than the current month.
I defined two variables:
CURRENT_YEAR = Year(Today())
CURRENT_MONTH= date(Today(),'MM')
For my measurement, I have this:
IF(IsNull(GetCurrentSelections()),sum({<[MONTH={"<=$(CURRENT_MONTH)"},[YEAR]={$(ANNEE_EN_COURS)},[N]={'100','199'}>} [AMOUNT]),
sum({<$(=[YEAR]),[MONTH]={"<=0$(=MAX([MONTH]))"},[N°]={'100','199'}>} [AMOUNT]))
Moreover, it is a cumulative measure.
I removed the option: include null values.
It doesn’t work, if I don’t make a selection, my chart is on 2022 but I have data until December. I think that’s because of the cumulative—
Could you please help me?
Thank you so much!
I found the solution in the parameters of the dimension :
=if(GetSelectedcount([Période RESULT_BILAN])>0 OR GetSelectedcount([Année RESULT_BILAN])>0,Max([Période RESULT_BILAN]),NUM(Month(Today())))
HI @Aurél
I would split the charts and get them working Individually first. Consider using a container then to show the charts?
One problem might be related {"<=0$(=MAX([MONTH]))"}
try {"<=$(=MAX([MONTH]))"}
Also Getcurrentselections() will be looking for selections on any field.
You could try this:
SUM({<[YEAR]={$(ANNEE_EN_COURS)},[MONTH]={"<$(=if(GetSelectedcount([MONTH])>0,Max([MONTH]),NUM(Month(Today()))))"}>} [AMOUNT])
Thank you but it doesn’t change anything.
If I select the year, it’s OK :
But if I don’t select the year, it’s not OK :
I found the solution in the parameters of the dimension :
=if(GetSelectedcount([Période RESULT_BILAN])>0 OR GetSelectedcount([Année RESULT_BILAN])>0,Max([Période RESULT_BILAN]),NUM(Month(Today())))