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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Need Help with a Reference Line Conditional Formatting Measure

I have created the below measure to give me a monthly baseline WO hours for the electrical team.  This is used as a reference line in my bar chart.  the issue I am running into is that if there are no WO hours for a facility then the baseline hours for that facility will not appear in the total.  Currently, my total monthly hours is 700 but my reference line is only at 325 because not all facilities have had WO hours for the first 6 weeks of the year. 

Any help updating the below measure to where i can get the total sum even if a facility has not had any hours?

MEASURE 'WOs'[Electric WO Baseline Measurev2] = VAR SelectedDivision = SELECTEDVALUE('WO Baseline hours'[Division])
	VAR SelectedFacility = SELECTEDVALUE('WO Baseline hours'[Facility])
	RETURN
		IF(
			ISFILTERED('WO Baseline hours'[Facility]),
			CALCULATE(MAXX(
					FILTER(
						'WO Baseline hours',
						'WO Baseline hours'[Division] = SelectedDivision && 'WO Baseline hours'[Facility] = SelectedFacility
					),
					'WO Baseline hours'[Electirc Baseline WO Hours]
				)),
			CALCULATE(SUMX(
					FILTER(
						'WO Baseline hours',
						'WO Baseline hours'[Division] = SelectedDivision
					),
					'WO Baseline hours'[Electirc Baseline WO Hours]
				))
		)

 

 

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous 

 

I've read your dax, maybe you can try the all(), allselected(), allexcept(), and removefilter() functions to remove unwanted filtering effects.
Here's a blog about contextual filtering:

Understand the Filter Context and How to Control i... - Microsoft Fabric Community

 

Best Regards,

Zhengdong Xu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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