Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
smithmc3
Advocate I
Advocate I

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
Eric_Zhang
Employee
Employee

@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.

View solution in original post

1 REPLY 1
Eric_Zhang
Employee
Employee

@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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.