The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a table (CompanyData) which provides multiple columns of data. Here is a summary example:
I want to use a slicer to enable a user to select several of these and for this to form a new table (CompanyPeers) whose data would be the same as the original table (CompanyData) but would by dynamic and alter according to the user selection. Then for columns 4, 5 and 6 (Operating Margin, Net Profit Margin and Global Revenue) in this new table (CompanyPeers) I want to calculate the max and min for each year.
The end objective is to allow me to have a dynamic chart that will plot one companies results (dark blue) against the max and min (light blue lines) of the selected peers over time, similar to the chart below.
What would be the best approach to doing this?
Carson, thank you for your response. I'm arriving at the same conclusion that suggestion 1 maybe the best option I have and develop something using various measures. If I find something that works I'll let you know.
Thanks.
Hi,@AutyDA .I am glad to help you.
Based on your description, you want to implement the following functionality in Power BI Desktop:
When a user accesses a report, you want to dynamically generate a table that changes dynamically based on the values selected by the slicer, and you want to use the data from this table to create
You also want to use the data from the table to create a new line chart visual, which dynamically changes based on the slicer data.
Your idea is very good, in fact there are many users have similar needs, want to dynamically change the slicer to generate a dynamically changing table, unfortunately, power bi does not support this dynamic selection to generate a dynamic table function. power bi in all the dynamically changing calculator table in the definition of the calculation is also fixed directly after the calculation, can not be done based on the general slicer filtering to generate a real change table. Real change tables.
If you need to implement such a requirement, you can try to come up with your requirements through Microsoft Fabric Ideas and it may be successfully implemented in the near future.
URL:
Home (microsoft.com)
Here are my suggestions for your idea:
suggestion1.
You mentioned that you want to end up with a line chart based on a slicer calculation, and you mentioned that the intermediate pre-dynamic table is the same as the original data table. I suggest that you use the original data table directly and calculate the results you want to display on the Y-axis using measure, and that you can use it as a judgment for data range filtering by creating a new measure, e.g., by relying on measure2 (for data range filtering in visual only), or by using measure1 (for data range filtering in visual only). measure2 (measure used to determine the range) to display measure1 (the real display in the Y-axis results of the measure) have values of the data
For example: measure2 =IF([measure1]<>BLANK(),1 , 0)
Then in the filter area of visual, put measure 2 =1 as the filter condition, then the line graph will dynamically change the display range of X-axis and Y-axis.
suggestion2.
You can try to use the Field Parameters feature to realize your idea.
Power BI's Field Parameters allow you to dynamically change the metrics or dimensions you are analyzing in a report. This means that you can explore and customize the report's analysis by selecting different fields.
Field Parameters have the following effects:
Dynamic switching of dimensions and measures: Users can select different dimensions (e.g., customer, product category) or measures (e.g., sales, profit) in the report to change what is displayed in the chart or table.
Enhance report interactivity: Reports become more interactive and personalized through the use of field parameters, allowing you to tailor the view of your data to your needs.
Simplify your report design: Instead of creating multiple charts for each possible combination, you can create a single parameter with multiple dimensions and metrics.
URL:
Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.