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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply

Match and Get the value

Hello

 

How can i write a measure - If ProductCode is 47, return the value 10 and if the ProductCode if 48, return the value 15 else return 0.

 

Table Name Poduct Codes

Feild Name ProductCode

 

ProductCode
47
47
48
48
48
49
47
49
48
50

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @gaurav-narchal 

Please check the below.

I could only create calculated column.

The reason is that there is no id column and, for instance, three of 47 will only appear once in the table visualization.

Picture5.png

 

 

New CC =
SWITCH( 'Product Codes'[ProductCode],
47, 10,
48, 15,
0)
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi, @gaurav-narchal 

Please check the below.

I could only create calculated column.

The reason is that there is no id column and, for instance, three of 47 will only appear once in the table visualization.

Picture5.png

 

 

New CC =
SWITCH( 'Product Codes'[ProductCode],
47, 10,
48, 15,
0)
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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