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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Legend switching off only partially

Hi all,

 

I have defined 2 measures with the following DAX code ('Huidig Jaar' means 'Current Year' and 'Vorig Jaar' means 'Last Year'):

 

Graaddagen Huidig Jaar = 
	IF(
		CONTAINS(xGraaddagenOnOff; xGraaddagenOnOff[Graaddagen On/Off]; "On");
			CALCULATE(
				SUM(WeatherMeasurements[GewogenGraaddagen])/24;
					FILTER(DimDate; YEAR(DimDate[DATUM]) = YEAR(NOW()) )
		);
		IF(
			CONTAINS(xGraaddagenOnOff; xGraaddagenOnOff[Graaddagen On/Off]; "Off");
				BLANK()
		))

 

Graaddagen Vorig Jaar = 
	IF(
		CONTAINS(xGraaddagenOnOff; xGraaddagenOnOff[Graaddagen On/Off]; "On");
			CALCULATE(
				SUM(WeatherMeasurements[GewogenGraaddagen])/24;
					FILTER(DimDate; YEAR(DimDate[DATUM]) = YEAR(NOW()) - 1)
		);
		IF(
			CONTAINS(xGraaddagenOnOff; xGraaddagenOnOff[Graaddagen On/Off]; "Off");
				BLANK()
		))



Subsequently I have built a filter, that allows for switching on/off the 2 corresponding lines in a 'Line and clustered column chart' according to this example. This works for the 2 lines.

But consequently the 2 legend items for these 2 measures should also switch on/off accordingly, but weirdly enough it only switches off the legend item for the measure 'Graaddagen Huidig Jaar', but not the legend item for the measure 'Graaddagen Vorig Jaar' (again, see attachments). Below you also find some screenshots which portray what is the case.

 

Measures for 'Graaddagen' switched onMeasures for 'Graaddagen' switched on

 

 

Measures for 'Graaddagen' switched offMeasures for 'Graaddagen' switched off

 

 

Does anyone have any idea how to fix it in such a way, that both measures are indeed not visible when they are being switched off through the filter? Thank you very much in advance!

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

In my test, everything works fine. Both of the two lefend items are visible/invisible together when I switch between ON and OFF option from the slicer. Since I cannot reproduce your scenario, would you please share your pbix file so that I can check for you?

 

This behavior is very odd, have you ever tried to close and reopen your report or recreated a new one to see whether issue persisted?

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I have tried closing and reopening it, switching from direct query to import mode, different machines...in all situations, the problem persists.

 

Do you have a direct e-mail address? Then I can send you the direct query version of the pbix, without the database credentials.

Hi @Anonymous,

 

Here is my e-mail address: v-yulgu@microsoft.com. You can send me your .pbix file for further analysis.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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