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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.