Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I am working on a Power BI Desktop that includes a Stacked Area Chart. The dataset contains three main columns: Category, Date, and Price. In the visual, the Date is on the X-axis, Price is on the Y-axis, and Category is used in the Legend. Additionally, I have implemented a date range slicer to filter the data based on user-selected time periods. My requirement is to enhance user interactivity by allowing users to assign a custom percentage value to each category dynamically. I want to create a visual element such as a matrix, table, or custom form where all available categories are listed, and in front of each, users can input a numeric percentage value (e.g., 10%, 20%, etc.). Based on these inputs, the stacked area chart should update accordingly by scaling the Price values per category. Moreover, if a user chooses to input values only for specific categories (e.g., A and D), the chart should display only those selected categories and hide the others. While I currently have five categories, the number may increase in the future, so the solution needs to be scalable without requiring manual intervention for every new category. I am seeking guidance or a built-in solution that supports this level of dynamic interaction within Power BI. Please advise on the best way to implement this functionality or suggest any custom visual or integration that may support it.
Hi @AeshaShah17 ,
This is a pretty interesting use case, and while Power BI doesn’t support direct user input like textboxes or forms natively, there’s a workaround using What-If parameters and a disconnected table approach.
Here’s a general idea:
This way, the stacked area chart will reflect only the categories with user-defined scaling, and it’ll hide the rest.
It’s not as seamless as a form input, but it works well with built-in visuals and scales as your category list grows.
Hope that helps get you started.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
Hi @AeshaShah17 ,
Thanks for reaching out to the Microsoft fabric community forum.
@burakkaragoz
Thanks for your prompt response
@AeshaShah17
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Best Regards,
Lakshmi Narayana
Hii @v-lgarikapat
Thank you for your response
Please find below the sample data related to my issue:
I would like to introduce a user input feature (e.g., a custom visual or table) where each category is listed, and users can assign a percentage weight to each one. Based on this input, the chart should dynamically reflect updated values (e.g., scaled prices), reorder categories based on user-defined weights, and optionally filter out categories with 0%.
Let me know if more clarification is needed.
Best regards,
Aesha Shah
Hi @AeshaShah17 Thanks for your response.
I’ve implemented the proposed logic using sample data and uploaded the PBIX file for your review. The solution includes:
A user input mechanism for assigning percentage weights per category
Dynamic calculation and visualization of adjusted values based on these weights
Optional filtering of categories with 0% weight
Reordering of categories based on user-defined weights
Please take a look and let me know if any refinements are needed or if you have suggestions for improvement.
If this post helped resolve your issue, please consider giving it Kudos and marking it as the Accepted Solution. This not only acknowledges the support provided but also helps other community members find relevant solutions more easily.
We appreciate your engagement and thank you for being an active part of the community.
Best regards,
LakshmiNarayana.
Hi @v-lgarikapat ,
Thank you so much for your quick response and for taking the time to implement and share the solution — I truly appreciate your effort.
I reviewed the PBIX file, and the overall logic looks good. However, I noticed that the user input mechanism doesn't fully meet my requirement. Specifically, I need to be able to multi-select categories and assign percentage weights to each of them simultaneously, which doesn’t seem to be working as expected in the current setup.
If there’s any way to tweak the solution to support multiple selections with individual weights, I’d be grateful for your guidance.
Thanks again for your support, and I really appreciate your help!
Best regards,
Aesha Shah
Hi @AeshaShah17 ,
Thank you for your thoughtful feedback
To implement dynamic multi-select categories and assign percentage weights to each of them simultaneously in Power BI, create a CategoryWeights table in Excel or another external source listing each category and a weight column (initially set to 1), and load this table into Power BI without linking it directly to your data model (as a disconnected table). In your main data table (SalesData with Category, Date, and Price), create a relationship via DAX using the RELATED or LOOKUPVALUE function to fetch the corresponding weight from the CategoryWeights table. Then, create a measure like Weighted Price =
SUMX (
SalesData,
SalesData[Price]
* LOOKUPVALUE (
CategoryWeights[Weight],
CategoryWeights[Category], SalesData[Category]
)
)
to calculate weighted prices. Use this measure in your visuals (Stacked Area Chart), and add a slicer or filter to exclude categories with a weight of 0. To enable dynamic user input, instruct users to update the Excel file (e.g., via OneDrive or SharePoint), and refresh the Power BI report to reflect changes; alternatively, embed a Power Apps visual in the report to allow users to edit weights directly within the report and write them back to the data source for live updates.
If this post helped resolve your issue, please consider giving it Kudos and marking it as the Accepted Solution. This not only acknowledges the support provided but also helps other community members find relevant solutions more easily.
We appreciate your engagement and thank you for being an active part of the community.
Best regards,
LakshmiNarayana.
Hi @v-lgarikapat
Thank you so much for you help and feedback
Kudos to your support. I will try this soulution and let you know how it goes.
I truely appreciate your efforts and support.
Hi @AeshaShah17 ,
You're very welcome! I'm glad I could help. Please feel free to reach out if you run into any issues or have more questions while trying out the solution.
Looking forward to hearing how it goes!
Best Regards,
LakshmiNarayana
Should i make a table for all the combinations like
A 0
B 0
A 1
B 1 till 100 like this
i didn't understand on which column did you suggest to make slicer
I want like if i select category A and 20% for it and category B and 10% and do not select C at all then the visual should show like 1st line should be of B and then A and others should not be displayed,
Also, I am not sure how to manage and save values for combinations like 20 for Category 1 , 10for Category 2 etc without adding slicers for each category as this is just sample image and in real life the category can go upto 30-40.
Thank You
User | Count |
---|---|
84 | |
76 | |
74 | |
48 | |
39 |
User | Count |
---|---|
114 | |
56 | |
51 | |
42 | |
42 |