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.
Solved! Go to Solution.
Hi @Lagoona23
The easiest way would be to add an extra Conditional Column in Power Query/Transform data specifying your conditions.
Happy to assist further if you can provide a data sample.
@Lagoona23 , In power query M you have If else
example
New Margin = ((if [Item.Brand] = "Brand 1" then 5 else
if [Item.Brand] = "Brand 2" then 5.5 else
if [Item.Brand] = "Brand 3" then 6.0 else
if [Item.Brand] = "Brand 4" then 6.5 else
7.0 )*([Qty]*[Price]) *((100-[Discount Percent])/100))/100
And text function https://docs.microsoft.com/en-us/powerquery-m/text-functions
with help of that you can do that
Hi @Lagoona23
The easiest way would be to add an extra Conditional Column in Power Query/Transform data specifying your conditions.
Happy to assist further if you can provide a data sample.
Thank you @Mariusz this worked for me, but have since noticed that you can only include 1 conditional - eg: you can't say If column A = 5 AND Column B = 5 so for some other transformations I'm looking at other things. Having an issue with concatenating 2 columns now but will post a separate question I think.
By the way the dataset I'm trying to transform is Avi Singh's Ultimate Calendar table - I'm changing it to suit my companies fiscal year.
Ah yes thank you I hadn't found that, it looks like it could work I will try it - many thanks.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |