Forum Discussion

Sahil_87's avatar
Sahil_87
New Member
4 years ago
Solved

Ignoring some rows while aggregating + selection on field.

Hi Experts - Could you please assist me on below query?

 

The channel field in the table has 4 rows (including Total) and it looks like as below:

I would like to get assistance on how to exclude Channel A,B & C numbers when Channel is not selected. In current scenario, SUM(Count) is giving the result as 10+20+15+40 = 85 when Channel is not selected. In other words, I would like to display only 40 when channel is not selected and show individual channels + total (4 rows) when channel is selected.

 

P.S. I understand it sounds weired to have Total as a row but unfortunately the sum of individual channels are not same as Total.

  • How about:

    Count = IF(ISFILTERED (Table[Channel]), SUM(Table[Count]), CALCULATE(SUM(Table[Count]), Table[Channel] = "Total")

2 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    How about:

    Count = IF(ISFILTERED (Table[Channel]), SUM(Table[Count]), CALCULATE(SUM(Table[Count]), Table[Channel] = "Total")

    • Sahil_87's avatar
      Sahil_87
      New Member

      It worked like a charm!! Many thanks Paul. Appreciate your swift response and assistance.