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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
UsePowerBI
Post Prodigy
Post Prodigy

How to use a placeholder for a calculated column?

Hello

 

I have a calculated column:

SWITCH([Column1], 1, 1, 2, ...)

 

How can I put a placeholder for when Column1=2 ?

If I put "TBD" or "", it says that variant data-type calculations are not allowed.

 

Thanks!

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

@UsePowerBI 

SWITCH([Column1], 
1, "1", 
2, "",
...)

or

SWITCH([Column1], 
1, 1, 
2, BLANK(),
...)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi @UsePowerBI 

If so, you need to use BLANK() instead of "TBD" or "", since "TBD" or "" are text format, nut 1,2 is number format, you could not put them into one number type column unless this column is a Text type. In that way, 1,2 should be define as this "1" , "2".

 

So just please adjust the formula as az38's reply. 

 

Regards,

lin

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

@UsePowerBI 

SWITCH([Column1], 
1, "1", 
2, "",
...)

or

SWITCH([Column1], 
1, 1, 
2, BLANK(),
...)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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