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
Mahendra_k
Helper I
Helper I

SWITCH DAX returning both text and numeric values — numeric values show left-aligned as text

Hi everyone,

 

I created a SWITCH DAX measure that returns a mix of text and numeric values depending on conditions.

Example:


Result =

SWITCH(

TRUE(),

Table[Status] = "A", "Approved",

Table[Status] = "P", "Pending",

Table[Status] = "N", 1200,

Table[Status] = "X", 980,

BLANK()

)


The measure works, but Power BI treats the entire column as text, so numeric values appear left-aligned and behave like text.

I tried using FORMAT() and changing visual alignment, but I want a solution where numeric values appear right-aligned like numbers while still keeping text for other conditions.

 

Is there any way to:

Keep the mixed output from SWITCH, and

Make numeric values display as numeric (right-aligned) in the same column?

 

Any ideas or workarounds would be appreciated!

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

5 REPLIES 5
PhilipTreacy
Super User
Super User

@Mahendra_k 

 

Not sure what is happening with your measure but when I create it, everything is right aligned.  And the values stay either text or numeric 

 

PhilipTreacy_0-1762845778169.png

 

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


v-achippa
Community Support
Community Support

Hi @Mahendra_k,

 

Thank you for reaching out to Microsoft Fabric Community.

 

Thank you @Ahmedx for the prompt response.

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the user for the issue worked? or let us know if you need any further assistance.

 

Thanks and regards,

Anjan Kumar Chippa

Hi @Mahendra_k,

 

We wanted to kindly follow up to check if the solution provided by the user for the issue worked? or let us know if you need any further assistance.

 

Thanks and regards,

Anjan Kumar Chippa

Ahmedx
Super User
Super User

If you do this as a calculated column, it won't work. Power BI doesn't support two data types for columns.

Ahmedx
Super User
Super User

pls try
Screenshot_1.png

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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.