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! Request now

Reply
Anonymous
Not applicable

Switch Function on Disconnected Slicer

Hey Everyone,

 

I wanted to first say thanks to everyone here, I have been on this site a few times a week in my last few months learning DAX and this place has been a huge help. 

 

I am running into an issue with the Switch function so I finally figured I'd post as this is for a report we are launching to our team next week and I need to finish this one final change. 

 

I have created a disconnected slicer for a ranking sheet we are working on. The slicer will allow you to select between "% To Target" "Sales Per Day" and "Total Sales" and see the values and sales people ranked. I already created the measures, and the following formula for the slicer:

 

AG Current Selection = 
SWITCH
	(FIRSTNONBLANK
		('GAT Slicer'[Type],
			'GAT Slicer'[Type]),
				"Sales Per Day",FORMAT([SPD MTD - AG],"$#,##0;($#,##0)"),
				"Total Sales",FORMAT([Total Sales AG],"$#,##0;($#,##0)"),
				"% To Target",FORMAT([% To GAT AG],"Percent")
		)

The original measures are formatted correctly as currency, percent, etc., however, this measure auto defaults to "Text" and I can't change it, so the rankings are wrong. I thought adding the "FORMAT()" function into the switch measure might fix the format issue and override the text formatting, but it's not fixing it. It all appears to be correct, but when sorted, it's sorting like a text column, i.e. $87,600 is sorted right below $9,700, etc.

 

Any help would be greatly appreciated!!


Thanks in advance.

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

Yes, it's a problem unfortunately. You could vote for my idea here. 

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/15231165-conditional-formatted-me...



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

2 REPLIES 2
MattAllington
Community Champion
Community Champion

Yes, it's a problem unfortunately. You could vote for my idea here. 

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/15231165-conditional-formatted-me...



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

Thanks for the response. That's a disappointment, but I just voted, let's hope they fix this soon. I had so many cool ideas that this kills. Although, looks like you posted that over a year ago so I won't hold my breath!

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