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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AnnaMagnusson
Helper I
Helper I

Possible to remove part of a measure?

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)

 

1.JPG

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))
1 REPLY 1
lbendlin
Super User
Super User

You will need to create separate measures for each line segment that you want to show.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors