The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
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.
Solved! Go to Solution.
Hi @iceteapilot ,
Try to create a conditional column(Add Column -> Conditional column) in "Edit Queries";
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.
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
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";
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
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
Thanks for the response.
All the premium segments contain the word premium..pls check the attached screenshot.
Ashish
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
81 | |
63 | |
56 |
User | Count |
---|---|
247 | |
122 | |
110 | |
77 | |
72 |