Forum Discussion
Stacked and Line Chart - comparing both years
- 8 years ago
Hi Amelia,
Change your formula to:
YTDCumlativeOrderValue = IF ( ISBLANK ( SUM( Fact_Orders[OrderValue] )), BLANK (), TOTALYTD( SUM( Fact_Orders[OrderValue] ) , Dim_Date[DateSK]) )Should give you the expected result, another way is to have your Dim_Date to end on the current date so you won't get any date values from today onwards so on your visuals there will not be future dates.
Regards,
MFelix
Hi Amelia,
How are you placing the values in the columns of your chart? Two columns one for each year?
I would create this measure:
PY YTDCumlativeOrderValue =
TOTALYTD (
SUM ( Fact_Orders[OrderValue] ),
DATEADD ( Dim_Date[DateSK], -1, YEAR )
)Then add it to your line also.
Regards,
MFelix
oh MFelix thats great :-) almost what i need. Now i have to sort out the october, november & december values recurring for this year
- MFelix8 years agoSuper User
- Amelia8 years agoFrequent Visitor
MFelix yes, i belive i can add a filter to TOTALYTD but having trouble with the syntax. the ye;llow line is the current year cumulative value based on
YTDCumlativeOrderValue = TOTALYTD( SUM( Fact_Orders[OrderValue] ) , Dim_Date[DateSK])
but obviously only want it to go to the current month - september
still getting up to speed on DAX
- MFelix8 years agoSuper User
Hi Amelia,
Change your formula to:
YTDCumlativeOrderValue = IF ( ISBLANK ( SUM( Fact_Orders[OrderValue] )), BLANK (), TOTALYTD( SUM( Fact_Orders[OrderValue] ) , Dim_Date[DateSK]) )Should give you the expected result, another way is to have your Dim_Date to end on the current date so you won't get any date values from today onwards so on your visuals there will not be future dates.
Regards,
MFelix