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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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