cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smithmc3 Regular Visitor
Regular Visitor

Year to Date Chart

So do you all know how to make it so that the actual only shows through the current month?  See below, top chart is the publication and the bottom on is the powerbi chart?  I put the code for how we calculate actual and planned.  Target is calculated the same as planned and the multipled by .77

 

Normal_Chart.PNGPowerBI_Chart.PNG

 

 

Actual = 
CALCULATE(
	SUM ('Months'[ActualPlanned]),
	FILTER(
		ALLSELECTED('Months'[Title]),
		ISONORAFTER('Months'[Title], MAX('Months'[Title]), DESC)
	)
)

 

 

 

Planned = 
CALCULATE(
	SUM ('Months'[AllPlanned]),
	FILTER(
		ALLSELECTED('Months'[Title]),
		ISONORAFTER('Months'[Title], MAX('Months'[Title]), DESC)
	)
)

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator Eric_Zhang
Moderator

Re: Year to Date Chart

@smithmc3

So you'd like the actual measure shows as in the top chart? I mean the red line shows blank after Sep instead of a horizontal line? If so, you could try

 

Actual =
VAR val =
    CALCULATE (
        SUM ( 'Months'[ActualPlanned] ),
        FILTER (
            ALLSELECTED ( 'Months'[Title] ),
            ISONORAFTER ( 'Months'[Title], MAX ( 'Months'[Title] ), DESC )
        )
    )
RETURN
    IF ( MAX ( 'Months'[Title] ) <= TODAY (), val, BLANK () )

If this is not your case, could you post any sample data? Do mask sensitive data before posting.

1 REPLY 1
Moderator Eric_Zhang
Moderator

Re: Year to Date Chart

@smithmc3

So you'd like the actual measure shows as in the top chart? I mean the red line shows blank after Sep instead of a horizontal line? If so, you could try

 

Actual =
VAR val =
    CALCULATE (
        SUM ( 'Months'[ActualPlanned] ),
        FILTER (
            ALLSELECTED ( 'Months'[Title] ),
            ISONORAFTER ( 'Months'[Title], MAX ( 'Months'[Title] ), DESC )
        )
    )
RETURN
    IF ( MAX ( 'Months'[Title] ) <= TODAY (), val, BLANK () )

If this is not your case, could you post any sample data? Do mask sensitive data before posting.