Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi!
Is there a way to remove/or ignore part(s) of a measure?
In my measure (comp straight) I want to remove the grey dashed line in the begining (10-01), since comp is blank there. Tried using firstnonblankvalue or filter, by using currentday >= a, but doesn't work. I would also like to do the same but if there are blank values for the last dates. I used a instead of nextdate but then the line between 10-06 and 10-09 isn't straight anymore.
Any suggestions?
(It's a cathegorical axis)
comp straight =
var s = ALLSELECTED(Dim_Machine_Comp[Name])
var p = allselected('dim_mach'[Name])
VAR CurrentDay = SELECTEDVALUE(Fact_IntDay[DateDay])
VAR PrevDate = CALCULATE(MAX(Fact_IntDay[DateDay]), and(Fact_IntDay[Moving Average] <> BLANK() , Fact_IntDay[DateDay] < CurrentDay), filter(dim_machine_comp, dim_machine_comp[name] in s), removefilters(dim_machine[Name]), filter('dim_mach', 'dim_mach'[Name] in p))
VAR NextDate = CALCULATE(MIN(Fact_IntDay[DateDay]), and( Fact_IntDay[Moving Average] <> BLANK() , Fact_IntDay[DateDay] > CurrentDay ), filter(dim_machine_comp, dim_machine_comp[name] in s), removefilters(dim_machine[Name]), filter('dim_mach', 'dim_mach'[Name] in p))
var a = FIRSTNONBLANKVALUE(Fact_IntDay[DateDay], [Comp])
var b = LASTNONBLANKVALUE(Fact_IntDay[DateDay], [Comp])
VAR Gap = calculate( value(NextDate-PrevDate))
VAR CurrentDiff = calculate(value(currentday - PrevDate))
VAR PrevD = CALCULATE(AVERAGE(Fact_IntDay[Moving Average]),Fact_IntDay[DateDay] = PrevDate,filter(dim_machine_comp, dim_machine_comp[name] in s), removefilters(dim_machine[Name]), filter('dim_mach', 'dim_mach'[Name] in p))
VAR NextD = CALCULATE(AVERAGE(Fact_IntDay[Moving Average]), Fact_IntDay[DateDay] = NextDate, filter(dim_machine_comp, dim_machine_comp[name] in s), removefilters(dim_machine[Name]), filter('dim_mach', 'dim_mach'[Name] in p))
VAR OutputValue = calculate(PrevD + ( Divide(NextD - PrevD , Gap) * CurrentDiff))
var sw = SWITCH( TRUE(), ISINSCOPE(Fact_IntDay[DateDay]), OutputValue, [comp comb hour straight lines])
return
calculate(if(isblank([Comp]), sw, [Comp]), filter('dim_mach', 'dim_mach'[Name] in p))
You will need to create separate measures for each line segment that you want to show.