Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Lucius_Artorius
		
			Lucius_ArtoriusHi, So I want to sum only latest month for each year like below
Right now as you can see i am able to generate this chart till 2023 with this expression SUM({<[CREATED_DATE-Year-Month.autoCalendar.MonthRelNo] = {"-10"}>} [FA_QTY_FUNC] * [AVERAGE_PRICE]) / 1000) 
because it has latest month which is 12, but for 2024 latest month is Feb so I want to only sum for feb data
Please Let me know how should I achieve this.
Thanks.
 Lucius_Artorius
		
			Lucius_ArtoriusI solved this by creating new two columns Latest_YM where I am storing latest month of specific year and second is YMFlag field I have created where I am subtracting both date fields if it is 0 then I put flag 0 otherwise 1
if (interval([Year-Month]-[YEAR_MONTH_CALC], 'd') = 0, 0 , 1)
And in expression I have filtered with SUM({<[YMFlag]={'0'}>} [FA_QTY_FUNC] * [AVERAGE_PRICE]) / 1000) 
Thanks everyone for helping me. If there is better solution Let me know but this work for me for now.
@Lucius_Artorius_Castus Perhaps this way?
SUM({<[CREATED_DATE-Year-Month.autoCalendar.MonthRelNo] = {"-10"}, Monthfield={"$(=Max(Monthfield))"}>} [FA_QTY_FUNC] * [AVERAGE_PRICE]) / 1000)
 qv_testing
		
			qv_testing
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		PFA,
 Lucius_Artorius
		
			Lucius_ArtoriusThanks for Reply,
It didn't work, Because I don't have monthfield I am using CREATED_DATE-Year-Month which is YYYY-MM date format(2024-02), Sorry I should have told you before, Please let me know what changes I should make with this format.
 Lucius_Artorius
		
			Lucius_ArtoriusThanks for reply,
let me try it.
 Lucius_Artorius
		
			Lucius_ArtoriusOk I tried it, it is only showing till 2023 as you can see in above chart, it is not generating the bar for 2024 where we want data of Feb which is max in 2024.
Below is log showing when I write expression
 Lucius_Artorius
		
			Lucius_Artorius@qv_testing @Anil_Babu_Samineni Just to be clear what I want is this
which I have achieved with this formula SUM({<[CREATED_DATE-Year-Month.autoCalendar.MonthRelNo] = {"-10"}>} [FA_QTY_FUNC] * [AVERAGE_PRICE]) / 1000)
somehow it worked, But when I loaded the new data it didn't work.
in this 2021 is showing data for Dec,
2022-Dec, 2023-Dec and 2024-JAN Because at that time I had data till Jan
Thanks.
@Lucius_Artorius_Castus From my expression given earlier can still deserve the same If you can change the Field name (Maybe in few case, you might needed the date formats around to get match).
We appreciate sharing sample data set and QVF together to have a look and we may suggest faster.
 Lucius_Artorius
		
			Lucius_ArtoriusSure,
Please find below attachment
 qv_testing
		
			qv_testing
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try with this..
Create one field in calendar like
Year(Date)*100+num(Month(date)) as YearMonth   //this will create a number like 202401...so on
Load Year as TestYear,
         Max(YearMonth) as YearMonth,   // Year wise max year month
        '1' as MaxYearMonthFlag
resident Calendar
group by Year;
in expression you can use MaxYearMonthFlag={1}
