Forum Discussion
ArchStanton
Power Participant
2 years agoRemove future values but keep months on x axis
Hi I would like to remove the future line values from this chart but keep the Apr - Mar x axis visible. The line axis is based on this DAX code: DD YTD Cases = CALCULATE(
...
amitchandak
Super User
2 years agoArchStanton , Try like
DD YTD Cases =
var _max = maxx(allselected('Case'), 'Case'[Case Date])
return
return if(Max(Date[Date]) <=_max ,
CALCULATE( TOTALYTD(COUNT('Cases'[Case Number]),'Date2'[Date],"31/3")), blank())
ArchStanton
Power Participant
2 years agoI don't have a column called 'Case Date' so i'm not sure how to implement this?
I do have a 'Created on' date in the Cases table which I've tried using but I get this error:
DD YTD Cases2 =
VAR _Max = MAXX(ALLSELECTED('Cases'),'Cases'[Created On])
RETURN
IF(MAX(Date2[MonthName] <= _Max,
CALCULATE(
TOTALYTD(COUNT('Cases'[Case Number]),'Date2'[Date],"31/3"),BLANK())))
The Month in my x-axis comes from the Date2 calendar table and it is sorted by FYMonthNo where APR = 1st month. Created On and Date2[Date] has an active relationship in my model.