Memory blank ! Projecting my line to match Table

Sorry guys having a bad day and cant remember how i get my STD Dev line to finish at the end of the ship set data set.

See photo i want the STD Dev line (Blue line) to stop at SS 162.

I was sure it was ALLSELECTED function taking into account my table filter???

Standard Deviation Line = CALCULATE([X+3σ],ALLSELECTED(‘SAP Last 40 Ship Sets (Hassan)’[Ship Set]))

Appologies in advance i know its simple

Dan

@Krays23,

I think this should do the trick:

Standard Deviation Line = 

IF(
	‘SAP Last 40 Ship Sets (Hassan)’[Ship Set] <= 162,
	CALCULATE(
		[X+3σ],
		ALLSELECTED(‘SAP Last 40 Ship Sets (Hassan)’[Ship Set])
	),
	BLANK()
)
  • Brian

Hi brian

It would but the ss are dynamic not always 162

Cheers

@Krays23,

I wondered that, but without seeing the PBIX file I didn’t have more to go on. What’s the decision rule that governs when you want that line to terminate?

  • Brian

pbix attached.

Power BI Initiatives.pbix (1.2 MB)

@Krays23,

It took me a little while to figure out why ship set 162 was special, in order to set the proper filter condition, but I think I got it.

Standard Deviation Line = 

VAR MaxView =
CALCULATE(
        MAX( 'SAP Last 40 Ship Sets (Hassan)'[Ship Set] ),
        FILTER(
            ALLSELECTED('SAP Last 40 Ship Sets (Hassan)'),
            [Work center] = "BFC-10"
        )
     )

RETURN
IF( 
    SELECTEDVALUE( 'SAP Last 40 Ship Sets (Hassan)'[Ship Set] ) <= MaxView,
	[X+3σ],
    BLANK()
)

Hope this is what you needed.