Forum Discussion

AeshaShah17's avatar
AeshaShah17
Regular Visitor
1 year ago
Solved

Get help in Power BI

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-...
  • v-lgarikapat's avatar
    v-lgarikapat
    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
    .

  • v-lgarikapat's avatar
    v-lgarikapat
    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
    .