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.
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 Name | Link to content |
A1 | on hold |
B1 | https://lorenipsum1111 |
C1 | on hold - needs funding |
D1 | https://lorenipsum2222 |
E1 | in process - waiting for location |
F1 | in process |
Appreciate your help.
Solved! Go to Solution.
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,
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,
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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.