Forum Discussion

DineshbabuR's avatar
DineshbabuR
New Member
1 year ago
Solved

Help with Building Comparison Carts in Power BI

Hi Team,

I'm working on a Power BI project where I have several tables, including Products, Costs, and Past Selling History. The values in the Costs and Past Selling History tables only include unit prices per product.

The user wants to create three different carts that can have the same or different product selections, and they would like to compare the total prices of these carts. Additionally, I need a way for users to input quantities for each product in all three carts to calculate the total value.

I have a couple of questions:

  1. Multiple Selections: Is it possible to allow users to select products from a single table for three different carts and store these selections separately for comparison?

Each String is a cart & will be having multiple Products.

2. User Input for Quantities: Can we enable users to enter quantities for each product in all three carts?

I appreciate your guidance on these requirements. Thank you!

 

Best Regards,

Dinesh Babu

  • Ensure you have a Products table with at least ProductID and UnitPrice

     

    • Go to the Modeling tab and create What-If parameters for each cart (e.g., Quantity_Cart1, Quantity_Cart2, Quantity_Cart3).
    • Set the data type to Whole Number and define a reasonable range for the quantity.

      Create measures:

      Total_Cart1_Price = 
      SUMX(
      Products,
      Products[UnitPrice] * [Quantity_Cart1 Value]
      )

      Similarly for Cart 2 and 3.

       

      • Use slicers to allow users to select products.
      • Add cards or tables to display the total prices of each cart.

         

         

3 Replies

  • Technically speaking, yes, it can probably be done. You can also eat soup with a fork if you want, but that'st not the best tool for the job!

     

    You should explore What If parameters: Use parameters to visualize variables - Power BI | Microsoft Learn 

    They are basically user inputs into your model. They differ from Power Query Parameters. 

     

    You may need to have three of them, for each of the three different products.

  • Ensure you have a Products table with at least ProductID and UnitPrice

     

    • Go to the Modeling tab and create What-If parameters for each cart (e.g., Quantity_Cart1, Quantity_Cart2, Quantity_Cart3).
    • Set the data type to Whole Number and define a reasonable range for the quantity.

      Create measures:

      Total_Cart1_Price = 
      SUMX(
      Products,
      Products[UnitPrice] * [Quantity_Cart1 Value]
      )

      Similarly for Cart 2 and 3.

       

      • Use slicers to allow users to select products.
      • Add cards or tables to display the total prices of each cart.

         

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, DineshbabuR 

    May I ask if you have gotten this issue resolved? If it is solved, please share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.


    If it is not resolved, I hope you will provide the full .pbix file via OneDrive or SharePoint. Please be careful to remove all sensitive information and we will do our best to provide ideas for your issue.

     

     

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Fen Ling,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.