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
srkase
Helper IV
Helper IV

CALCULATED COLUMN CUSTOMISATION

Hi

 

I have a table name prod_cable.  Column Name : minorgroup

Minor group has the following values. 4" Set , 5" Set, 6" set, etc...

 

I wanted to create a calculated column.

 

prod_Cable[minorgroup] = 4"set , then value is 18

prod_Cable[minorgroup]=5" set, then vlaue is 20... etc

 

Kindly advise.

 

Regards

 

SRK

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@srkase 

With my test the issue is the " sign of 4" Set, power bi cannot read "" quotes properly when your cell includes ". To workaround this issue for now, you may replace 4" Set to 4' Set, basically you can use any sign other than ".

 

Then use the Switch formula from above replace the quote parts to "4' Set", "5' Set", etc.

 

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

View solution in original post

5 REPLIES 5
V-pazhen-msft
Community Support
Community Support

@srkase 

With my test the issue is the " sign of 4" Set, power bi cannot read "" quotes properly when your cell includes ". To workaround this issue for now, you may replace 4" Set to 4' Set, basically you can use any sign other than ".

 

Then use the Switch formula from above replace the quote parts to "4' Set", "5' Set", etc.

 

Paul Zheng _ Community Support Team
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

Hi @srkase 

try to create a SWITCH column like

Column = 
SWITCH(prod_Cable[minorgroup],
"4""set", 18,
"5""set", 20,
"Other"
)

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

am getting the following error..

 

1.jpg

Hi,

Looks like there is an issue with quotes used.

Please try any one of the below 

 

Column =
SWITCH(prod_Cable[minorgroup],
"4"set", 18,
"5"set", 20,
"Other"
)

 

OR using NESTED IF Condition:

Column =

IF(

prod_Cable[minorgroup] = "4"set",18,

prod_Cable[minorgroup] = "4"set",20,

"Other"

)

 

Thanks

Greg_Deckler
Super User
Super User

Seems like maybe:

 

Column =
  SWITCH('prod_cable'[minorgroup],
    "4"" Set",18,
    "5"" Set",20,
    ...
  )

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.