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
Flashed
Frequent Visitor

Add Column in Query

Hello You All,

 

I'am busy building a report in de powerbi desktop application.

I want to categorize my customers manually. Because my dataset doesn't have this information.

So is there a way to create a column  or something else where I manually can add the categorisation ID?

 

So what I want to create is the following:

 

Cat. ID can be A, B or C

 

Customer 001 = A

Customer 002 = B

Customer 003 = B

Customer 004 = C

Customer 005 = A

 

Hope to hear from you soon!

2 REPLIES 2
ricardocamargos
Continued Contributor
Continued Contributor

Hi @Flashed,

 

You can do it either by using DAX or M language:

 

M Language

 

DAX

 

 

You just use the IF clause, be aware M language is case sensitive.

 

IF clause in M language IF in M language.

 

Thanks,

 

Ricardo

Hi @Flashed

 

The solution of @ricardocamargos could solve your problem, do you have a try?

 

If it works, please accept his answer as a solution so that more people will find the solution easily. If you still have problems, you could post it to the forum.

 

In addition, you could try to add condition column in Query Editor which is more simple without writing codes. You could refer to this picture.

 

Capture2.PNG

 

Hope it can help you!

 

Best regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.