Forum Discussion
Get help in Power BI
- 1 year ago
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. -
- 1 year ago
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 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
- v-lgarikapat1 year agoCommunity Support
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.- AeshaShah171 year agoRegular Visitor
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.- v-lgarikapat1 year agoCommunity 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