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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
iceteapilot
Helper I
Helper I

Add additional column in Query Editor

Hi,

 

I have data set for UAE automobile vehicle sales for 10 year period. So there are basically two types of vehicles in the data set: Mainstream and Premium. Within mainstream say there are 12 segments and within premium 6 segments. Each of the premium segments has a segment name with the word Untitled.png

 

premium attached to it unlike the mainstream segment. Example: B Premium Car, C Premium Car, etc.

How do i add an additional column with these details against each of the cars?

There are 5530 rows in the data set, maybe 4000+ for mainstream and balance for premium cars.

 

Attaching a screenshot..thanks in advance for feedback.  

 

1 ACCEPTED SOLUTION

Hi @iceteapilot ,

 

Try to create a conditional column(Add Column -> Conditional column) in "Edit Queries";

a1.PNG

a2.PNG

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Greg_Deckler
Super User
Super User

Difficult to say, I don't understand the logic of what data you want to add. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Logic is i want to add a column based on the segment name.

Wherever the segment name contains the word 'premium', the new column should have 'Premium Segment' in it.

Where there is no premium mentioned, 'mainstream segment' needs to be inserted in the new column..

 

 

Hi @iceteapilot ,

 

Try to create a conditional column(Add Column -> Conditional column) in "Edit Queries";

a1.PNG

a2.PNG

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HI @iceteapilot ,

 

You can create a calculated column using DAX expression as follows:

 

Segment Category = IF(CONTAINSSTRING(Table1[Segment name], "premium") = TRUE(), "Premium Segment", "Mainstream Segment")

 

Replace "Table1" with your table-name and "Segment name" with your segment name column in the above DAX.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Pragati11
Super User
Super User

Hi @iceteapilot ,

 

You can create a custome column in Query Editor using "Add Column" or you can even create a new calculated column using DAX expression.

 

In your screenshot below I see 5 columns. How do you check SEGMENT column for Mainstream or Premium? Like what all segements come under Premium and whatt segments come under mainstream?

If you can tell me the logic, I can try writing a DAX for you.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Thanks for the response.

 

All the premium segments contain the word premium..pls check the attached screenshot.

 

AshishUntitled.png

 

HI @iceteapilot ,

 

If you have already got a column containing those values - A Premium car, etc.; what you want to be added in new column?

Please explain your requirement properly, it is not clear.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.