Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi, I have two columns storage and destination.
And there are many reasons for stock being moved from storage to destination.
Depending on storage and destination it can have different description.
I tried to use create from example column but unfortuantelly it does not work for my case since there are to many variations.
I can only think of couple ways on how to get me result.
One is to create addiotional column from combining storage and destination columns and then do 'column from example' on that new column.
Other is to write e query that could do if storage is 'X' and destination is 'Y' then description would be 'Z'.
Any one know of any good solution that could work.
Keep in mind that on top of combinations that are in screenshot there could be more added in the future.
Thanks
Solved! Go to Solution.
Hi @Justas4478
Thank you rajendraongole1 for the great reply. If this has helped you solve your problem, please consider accepting rajendraongole1's reply as a solution.
Here are some of my suggestions that I hope will help you.
1. Write dynamic rules in the Power Query editor using the M language. Example:
= Table.AddColumn(
PreviousStep,
"Description",
each if [Storage] = "X" and [Destination] = "Y" then "Z"
else if [Storage] = "A" and [Destination] = "B" then "C"
else "Default Description"
)
2. If the combinations are very large and may change dynamically, it is recommended to maintain an external mapping table (e.g. Excel or database) with storage, destination and corresponding description. Then import the mapping table into Power BI. Use the MERGE function to join the master table to the mapping table and find the description based on storage and destination.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Justas4478
Thank you rajendraongole1 for the great reply. If this has helped you solve your problem, please consider accepting rajendraongole1's reply as a solution.
Here are some of my suggestions that I hope will help you.
1. Write dynamic rules in the Power Query editor using the M language. Example:
= Table.AddColumn(
PreviousStep,
"Description",
each if [Storage] = "X" and [Destination] = "Y" then "Z"
else if [Storage] = "A" and [Destination] = "B" then "C"
else "Default Description"
)
2. If the combinations are very large and may change dynamically, it is recommended to maintain an external mapping table (e.g. Excel or database) with storage, destination and corresponding description. Then import the mapping table into Power BI. Use the MERGE function to join the master table to the mapping table and find the description based on storage and destination.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Justas4478 - create a new calculated column as below
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
73 | |
55 | |
42 | |
38 |
User | Count |
---|---|
100 | |
63 | |
56 | |
48 | |
45 |