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

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.

Reply
GeorgesKV
Helper I
Helper I

New column with "yes" or "no" based in another column

Hi,

So I have a column with 5 clients, 3 of those clients pays per hour, 2 doesn't, I have the name of those clients in a column A, I would like to create a Column B that will fill itself with "yes" or "no" based on the name of the client.

Probably something with DAX?

Regards,

1 ACCEPTED SOLUTION

Yes. in power query, add a Customer Column, then enter " if [Customer Column] ="Customer A" then "Yes" else if [Customer Column]="Customer B" then "Yes" else "No".

 

The above will create the Yes or No as a Column in your data.

 

Then you can create the new Meassure for the Hour based on the IF statement.

View solution in original post

6 REPLIES 6
Joorge_C
Resolver II
Resolver II

You can do this with an IF statment, you will need to know what column or value identifies your customers. Example =IF(CUSTOMER [VALUE] ="Hour","Yes,"No")

Anonymous
Not applicable

Based on what condition you want to fill Yes or no? pls share example.

As you can see in this image, Client A, B and C pays per hour while D and E pays monthly, what I did until now in Excel was to filter the clients and just select "Yes" and pull down to fill if it all and do the same with "No", I was wondering if Power Bi is able to do that automatically for me or if I will need to do it manually every week.

 

  image.png

If you already have data like below 

 

image.png

 

then you just have create a visual to show count of clients for you (without applying filter as Yes and No as you were doing in excel), and you would have result like below

 

image.png

 

Regards,

Arvind


If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!
Proud to be a Super User!!

Yes. in power query, add a Customer Column, then enter " if [Customer Column] ="Customer A" then "Yes" else if [Customer Column]="Customer B" then "Yes" else "No".

 

The above will create the Yes or No as a Column in your data.

 

Then you can create the new Meassure for the Hour based on the IF statement.

@Joorge_C Thank you, I imagined it was something like that but I'm new to using "then" in things haha 

@arvindsingh802 I have it now because I've did it manually for a pivot table in excel, the raw data doesn't show if it's a "yes" or "no" and since we're migrating from Excels reports to Power Bi I thought about cutting this manual work down too. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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