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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
saipawar
Helper IV
Helper IV

How to create case statement to group rows that have similar text?

Hi,

 

How can I create a case stament in Power BI to group specific rows. 

I would like to create a pie chart or a bar chart that shows the status of customer's content by 3 categories - 

1) On Hold

2)In Process

3)Completed (if the second column in the sample data below contains a url).

 

In a case statement I would have done something like this - 

CASE 

WHEN `Customer` LIKE "in pocess%" THEN "WIP"

WHEN `Customer1 LIKE "%HTTPS%" THEN "Completed"

ELSE

NA

How can I perform a similar query in Power BI?

 

Here's some sample data.

Customer NameLink to content
A1on hold
B1https://lorenipsum1111
C1on hold - needs funding
D1 https://lorenipsum2222
E1in process - waiting for location
F1in process
  

 

Appreciate your help.

 

 

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

Hi @saipawar ,

 

We can create a calculated column to meet your requirement:

 

Category =
IF (
    CONTAINSSTRING (
        [Link to content],
        "in process"
    ),
    "WIP",
    IF (
        CONTAINSSTRING (
            [Link to content],
            "https"
        ),
        "Completed",
        "NA"
    )
)

 


Best regards,

 

Community Support Team _ Dong Li
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-lid-msft
Community Support
Community Support

Hi @saipawar ,

 

We can create a calculated column to meet your requirement:

 

Category =
IF (
    CONTAINSSTRING (
        [Link to content],
        "in process"
    ),
    "WIP",
    IF (
        CONTAINSSTRING (
            [Link to content],
            "https"
        ),
        "Completed",
        "NA"
    )
)

 


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
VasTg
Memorable Member
Memorable Member

@saipawar 

 

Look into FIND or SEARCH dax commands and use them in SWITCH.

 

https://docs.microsoft.com/en-us/dax/search-function-dax

https://docs.microsoft.com/en-us/dax/find-function-dax

 

If it helps, mark it as a solution
Kudos are nice too.

Connect on LinkedIn

Hi @VasTg 

 

Should I create a new measure for this? can you give me an example of the query?

 

I am a newbie to DAX and some direction would definitely help.

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors