Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Please help: Deeper Sum Formula

I have a big table, data is:

 

-----------------------------------------

Date             City                   Store     Product             Price

 Jan 01         Toronto              A             TV1                 500

 Jan 01         Toronto              B             TV2                 550

 Jan 01         Ottawa               C             Laptop1          600

 Jan 01         Ottawa               D             Laptop2          650

 

Jan  02          Toronto              A             TV1                499

Jan  02          Toronto              B             TV2                 549

Jan  02          Ottawa               C             Laptop1          599

Jan  02          Ottawa               D             Laptop2          649

 

Jan  03          Toronto              A             TV1                498

Jan  03          Toronto              B             TV2                 548

Jan  03          Ottawa               C             Laptop1          598

Jan  03          Ottawa               D             Laptop2          648

 

---------------------------------------------------

 

Price changes every day.

 

I have a date filter, set date = 'Jan 01',  I want to display:

-----------------------------------------------------------------

City                   Store     Product             Price             Deno

Toronto              A             TV1                  500             1050

Toronto              B             TV2                  550             1050

Ottawa               C             Laptop1           600             1250

Ottawa               D             Laptop2           650             1250

---------------------------------------------------

 

How to get Deno? ( sum of prices in a city, two filters: city, date)

The following picture

I need a column shows 2300 in the first row, then 5 rows (City Ottawa) show 1250,

5 rows show 1050. 

 

Using ALLEXCEPT doesn't work because there are two filters: city, date.

 

Please help me.

 

 

 

 

 

 

 

 

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak , Thank you very much for your reply. I tried all formula you gave. Name them as D1, D2, D3. The picture I got is:

      What I want is a ratio. Now I am looking for a denominator.

      In the above picture, column 2 is the closet column to the solution. 

      I need a picture replace 600, 650 with 1250 and replace 500, 550 with 1050.

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        I use 

        Deno = Calculate(SUM('Table'[Price]), ALLEXCEPT('Table', 'Table'[Date], 'Table'[City]))

        to get the following picture:

         

         

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak , your formula make me solved my project, so I also accept it as a solution.Thank you.