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.
Hi
I have a current layout in Power Query loaded to Excel with slicers as filters (I don't use PowerBi yet).
The current data in Power Query look as below:
Item Number | Item Sales Price | Item Cost Price
I want an option in my Excel file to increase/decrease the sales or cost price with a specific number or percentage.
Preferably like this:
Item Number | Item Sales Price | Item Cost Price | Item Sales Price Simulated | Item Cost Price Simulated
The idea is that it should be easy to simulate prices without changing the original source of the data, but only a visual in Excel.
Can you help me? Thank you
Solved! Go to Solution.
Hi @KasperJ90,
Rather than adding a column to every row of your data for the simulated increase. The more appropriate way to do it would be to use Power Pivot to create a measure. It has the advantage of working irrespective of the grouping used in the pivot table and reduces the model size by not adding unnecessary columns.
So still following the steps provided by @Ehren but stopping short of creating the column in your main table.
See the gif below and attached file for reference.
Unfortunately, it doesn't solve the issue of needing to manually refresh at least one of the queries.
If you have the option to use a macro enabled workbook then I would recommend watching this video (https://www.youtube.com/watch?v=nVoqWGIN7Mc&ab_channel=ExcelIsFun) as a way of simplifying the process for the consumers.
I hope this helps.
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
PQ only refreshes its results when you trigger a refresh. If you want the updates to be instantaneous, you would need to define your simulated columns in Excel, by referencing the loaded PQ data and multiplying the simulation percentage.
Thank you - can you guide me here on how to do it?
That's more of an Excel quesiton than a PQ one, but here you go:
= <click on the PQ Sales Price value in the same row> * (1 + <click on the percentage cell>)
You should end up with something like this:
Thank you - but I wanted to include it in my pivottable. The reason is that many people use different filters etc. so the size of the table changes a lot. If it is not possible to automatically refresh the pivottable when changing the cell with a new percentage I will use the first method you showed that requires a refresh.
Hi @KasperJ90,
Rather than adding a column to every row of your data for the simulated increase. The more appropriate way to do it would be to use Power Pivot to create a measure. It has the advantage of working irrespective of the grouping used in the pivot table and reduces the model size by not adding unnecessary columns.
So still following the steps provided by @Ehren but stopping short of creating the column in your main table.
See the gif below and attached file for reference.
Unfortunately, it doesn't solve the issue of needing to manually refresh at least one of the queries.
If you have the option to use a macro enabled workbook then I would recommend watching this video (https://www.youtube.com/watch?v=nVoqWGIN7Mc&ab_channel=ExcelIsFun) as a way of simplifying the process for the consumers.
I hope this helps.
Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
If you found this post helpful, please give Kudos. It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen. If you find my signature vaguely amusing, please give Kudos. | Proud to be a Super User! |
Ok. Here's how to do that:
Hi Ehren
Thank you!
I followed your guideline and I can set it up - but how can I get the data to automatically refresh when I change the percentage in the cell (defined as SalesPriceSimPct)? If I could change the percentage from 5% to 10% and then my tables change it would be amazing.
Are you wanting to adjust all the rows by the same percentage?
If so, you could look into either using PQ Parameters, or pulling the percentage from a cell in your workbook and applying it via Add Custom Column.
Hi Ehren
Thanks for your input. I want to calculate like below where I can enter a percentage (or number) that will change the sales price and revenue. See below. My data comes from an SQL database via Power Query so I can not just use cells for an calculation as in my examples. How can I set it up?
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.