Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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.
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |