Skip to main content
cancel
Showing results for 
Search instead 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

Reply
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 NAMEDATEACTIVITY
John Johnson01-01-2021W (for worked)
John Johnson02-01-2021F (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 NAMEWORKED?
John Johnson

YES

John DoeNO

 

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
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please refer this measure:

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

vjaywmsft_0-1652864057147.png

 

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.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please refer this measure:

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

vjaywmsft_0-1652864057147.png

 

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.
Arul
Super User
Super User

@Anonymous ,

you can try this by creating calculated column,

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

Arul_1-1652513199959.png

 

Arul_0-1652513147608.png

Thanks,

Arul

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
Europe Fabric Conference

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 Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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