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
summer18
Helper III
Helper III

help with switch(true)

I know this is easy for you guys but my formula could not seem to work. I need help on the formula in red font

 

RESULT =
SWITCH(TRUE(),
'Table'[Type]="Series",'Table'[Grade_ Assignment],
'Table'[Type]="Movie" && ISBLANK('Table'[Adviser]) && 'Table'[Title]="Beauty & the Beast",'Table'[Grade_ Assignment],
'Table'[Adviser]
)

 

 

Here is my desired result:

 

img004.jpg

 

Hoping for any assistance.  Thank you in advance

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @summer18 

According to your description and the sample picture, I can roughly understand your requirement, I think you can transform your DAX formula like this to achieve the result:

RESULT =

SWITCH(TRUE(),

'Table'[Type]="Series",'Table'[Grade_Assignment],

'Table'[Type]="Movie" && 'Table'[Adviser]=BLANK() && 'Table'[Title] = "Beauty & the Beast",'Table'[Grade_Assignment],

'Table'[Type]="Songs" && 'Table'[Adviser]=BLANK() && 'Table'[Title] = "Baby Shark",'Table'[Grade_Assignment],

'Table'[Adviser]

)

 

And you can get what you want, like this:

vrobertqmsft_0-1624875159664.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

3 REPLIES 3
v-robertq-msft
Community Support
Community Support

Hi, @summer18 

According to your description and the sample picture, I can roughly understand your requirement, I think you can transform your DAX formula like this to achieve the result:

RESULT =

SWITCH(TRUE(),

'Table'[Type]="Series",'Table'[Grade_Assignment],

'Table'[Type]="Movie" && 'Table'[Adviser]=BLANK() && 'Table'[Title] = "Beauty & the Beast",'Table'[Grade_Assignment],

'Table'[Type]="Songs" && 'Table'[Adviser]=BLANK() && 'Table'[Title] = "Baby Shark",'Table'[Grade_Assignment],

'Table'[Adviser]

)

 

And you can get what you want, like this:

vrobertqmsft_0-1624875159664.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-robertq-msft 

Kumail
Post Prodigy
Post Prodigy

Hello @summer18 

 

If you could send sample .pbix that demonstrate what you are looking to get. It would really help providing you a quick solution.

 

Regards
Kumail Raza

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.