cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## How to determined if a value exist on a column and replace it by yes or no

Hi everyone!

today i got asked on how i can determine if a worker actually worked or not on a certain date, i have a table with 3 important columns 1 with the name of the worker, the other with dates of month and the last with the activity done (shortened to just 1 character), what i need to determine is if X worker on a certain date was active or not, if that doesn't result very clear i'll put a graphic example:

 WORKER'S NAME DATE ACTIVITY John Johnson 01-01-2021 W (for worked) John Johnson 02-01-2021 F (for free day)

and the last task i need to do is to be able to visualize in a table graphic instead of the character for the activity just a yes or no in case that in the example shown above John Johnson on 01-01-2021 actually worked, so the final idea should look like this:

 WORKER'S NAME WORKED? John Johnson YES John Doe NO

all data must be filtered by date, filter i have currently working on a calendar table, so that would be it, any help would be great, thanks in advance

1 ACCEPTED SOLUTION
Community Support

Hi @Anonymous ,

``````tes =
SWITCH (
TRUE (),
CONTAINSSTRING ( SELECTEDVALUE ( 'Table'[ACTIVITY] ), "W" ), "YES",
CONTAINSSTRING ( SELECTEDVALUE ( 'Table'[ACTIVITY] ), "F" ), "NO"
)
``````

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
2 REPLIES 2
Community Support

Hi @Anonymous ,

``````tes =
SWITCH (
TRUE (),
CONTAINSSTRING ( SELECTEDVALUE ( 'Table'[ACTIVITY] ), "W" ), "YES",
CONTAINSSTRING ( SELECTEDVALUE ( 'Table'[ACTIVITY] ), "F" ), "NO"
)
``````

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Super User

@Anonymous ,

you can try this by creating calculated column,

``Yes/No = IF(Worker[ACTIVITY]="W","Yes","No")``

Thanks,

Arul

Proud to be a Super User!

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors