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

Switch true with multiple data types

Hi all,

 

I have a switch true query that returns whole numbers, decimals numbers and currency. This is causing issues with data formatting in the visuals and tooltips. They are all defaulting to 2 decimal places.

 

When hovering over the data I'd like the pop up to show the data as formatted in the measure howeverI'm unsure what the best way to deal with this is.

 

 

6 REPLIES 6
Anonymous
Not applicable

Hi, @Anonymous 

I don't really get what you mean by "switch true query". Could you clarify the code or your situation, maybe some screen shots?

 

Thank you

Paul,
Best

Anonymous
Not applicable

Hi Paul,

 

It is a switch formula which links to different reports. Similar to the below:

 

Column 2 = 

SWITCH(TRUE(),

   Dates[Date]>01/01/2007 && Dates[Date]<08/30/2008,"2007/2008",

   Dates[Date]>08/31/2008 && Dates[Date]<08/30/2009,"2008/2009",

   Dates[Date]>08/31/2009 && Dates[Date]<08/30/2010,"2009/2010",

   Dates[Date]>08/31/2010 && Dates[Date]<08/30/2011,"2010/2011)

Anonymous
Not applicable

Hi, mish

I have made some tests with the switch true function using a random sample, however it does not appear to have the decimal issue like you do. Maybe you can have a look at the data types of the used columns, and the decimal format underneath. 

Best,
Paul

Anonymous
Not applicable

Hi Paul,

 

The data I provided was sample data, however imagine one data source was currency and one was volume. That is where the issue lies - PowerBI does not format the data based on its source. And if you try to add a format function, it switches to text which is useless with bar graphs. Unfortunately I do not believe there is a way to do what I wanted, yet.

 

Thank you.

Anonymous
Not applicable

Hi,

 

you colud try setting your measure as text and formatting values into the switch functions

 

Regards

Lorenzo

Anonymous
Not applicable

Unfortunately the data is presented as a graph so text wouldn't work. It seems currently there just isn't a way to do this?

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.