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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
MickeLearnPBI
Helper I
Helper I

Problem with Switch and more than... Any ideas?

I have tried to do a dax with switch but does not seem to be working with value under och over.

 

Anyone have any ideas to do it better?

 

[Status] =
SWITCH(
TRUE(),
'table'[InvestigationID] = 0 && 'table'[DecisionID] > 0, "Notification One - investigation not opened",
'table'[DecisionID] = > 0, "Notification two - Decision not to open investigation",
'table'[InvestigationID] = > 0, "Actualizations processed",
'table'[InvestigationID] = 0, "New actualizations",
"Closed actualizations"
)

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from @Jihwan_Kim , please allow me to provide another insight:

 

Hi @MickeLearnPBI ,

 

Based on your description, the calculated column created, refer to the following:

Status = 
SWITCH(
    TRUE(),
    Notifications[InvestigationID] = 0 && Notifications[DecisionID] > 0, "Notification One - investigation not opened",
    Notifications[DecisionID] > 0, "Notification two - Decision not to open investigation",
    Notifications[InvestigationID] > 0, "Actualizations processed",
    Notifications[InvestigationID] = 0, "New actualizations",
    "Closed actualizations"
)

vkongfanfmsft_0-1717139103818.png

 

Best Regards,
Adamk Kong

 

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
Anonymous
Not applicable

Thanks for the reply from @Jihwan_Kim , please allow me to provide another insight:

 

Hi @MickeLearnPBI ,

 

Based on your description, the calculated column created, refer to the following:

Status = 
SWITCH(
    TRUE(),
    Notifications[InvestigationID] = 0 && Notifications[DecisionID] > 0, "Notification One - investigation not opened",
    Notifications[DecisionID] > 0, "Notification two - Decision not to open investigation",
    Notifications[InvestigationID] > 0, "Actualizations processed",
    Notifications[InvestigationID] = 0, "New actualizations",
    "Closed actualizations"
)

vkongfanfmsft_0-1717139103818.png

 

Best Regards,
Adamk Kong

 

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

 

Thanks! That worked like a charm 👍

Jihwan_Kim
Super User
Super User

Hi, I guess you are trying to create a calculated column?
Please try something like below whether it suits your requirement.

 

[Status] =
SWITCH (
    TRUE (),
    'table'[InvestigationID] = 0
        && 'table'[DecisionID] > 0, "Notification One - investigation not opened",
    'table'[DecisionID] >= 0, "Notification two - Decision not to open investigation",
    'table'[InvestigationID] >= 0, "Actualizations processed",
    'table'[InvestigationID] = 0, "New actualizations",
    "Closed actualizations"
)

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

That almost worked. It seems that when I use this below i only get the two first results in the new column =
'table'[InvestigationID] = 0
&& 'table'[DecisionID] > 0, "Notification One - investigation not opened",
'table'[DecisionID] >= 0, "Notification two - Decision not to open investigation",

[Status] =
SWITCH (
    TRUE (),
    'table'[InvestigationID] = 0
        && 'table'[DecisionID] > 0, "Notification One - investigation not opened",
    'table'[DecisionID] >= 0, "Notification two - Decision not to open investigation",
    'table'[InvestigationID] >= 0, "Actualizations processed",
    'table'[InvestigationID] = 0, "New actualizations",
    "Closed actualizations"
)

 

Can i get all results in the same column somehow?

Hi,

I do not know well about your business logic, but please try writing down all conditions... something like below?

[Status] =
SWITCH (
    TRUE (),
    'table'[InvestigationID] = 0
        && 'table'[DecisionID] > 0, "Notification One - investigation not opened",
    'table'[InvestigationID] < 0
        && 'table'[DecisionID] >= 0, "Notification two - Decision not to open investigation",
    'table'[InvestigationID] >= 0
        && 'table'[DecisionID] < 0, "Actualizations processed",
    'table'[InvestigationID] = 0
        && 'table'[DecisionID] < 0, "New actualizations",
    "Closed actualizations"
)

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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