Forum Discussion

GR83's avatar
GR83
Regular Visitor
2 years ago

What If Analysis with Multiple Columns

    I have a fact table 

Date        Category          Qty         Price   

Jan 1        Biscuits             5              10           ------ Say Monday

Jan 2        Fruit                  7               5            ------ Say Tuesday

Jan 2        Biscuit              10              10           ------ Say Tuesday

Jan 4        Cake                  3               6           -----   Thursday

Jan 8        Fruit                  8                5           ------ Monday

Jan 8        Protien Bar        5               6            ------ Monday

 

I have Generated Series Tables for Each Category where Users can Select Price

This is a single select dropdown Slicer with range -1 to 100

I created a measure which gives default value from fact table if drop down is -1 else selected value for each Category

 

I need a measure which will Give me total sale amount (Qty * Price)  by multiplying user selected Price value from the single select dropdown. 

 

If I select Biscuit Price as 7 and Fruit 10 

 

My Data needs to be displayed 

Rows - Week Start Date 

Columns - Day Name in the week

 

 

I need Output In below Format 

Week Start Date       Monday   Tuesday   Wed   Thursday   Fri      Sat      Sun

Jan - 1                          35            105                      18          

Jan - 8                          110

 

 

 

 

2 Replies

  • GR83 , Try a measure like

     

    Sum( Table,
    Switch([Category],

    "Fruit", selectedvalue(FruitParam[Value]) ,

    "Biscuit",, selectedvalue(BiscuitParam[Value]) ,

    // add others

    ) * [Qty]*[Price])

    • GR83's avatar
      GR83
      Regular Visitor

      I how do I use Table in Sum and Category In Switch?