Forum Discussion

Debbs1976's avatar
Debbs1976
Frequent Visitor
9 years ago

Is blank giving wrong total

Hi guys,

 

I've got a table and I only want to show the sum of one measure if another measure is not equal to zero.

 

I've created a calculation...

 

 

if(
      ISBLANK([COLUMN A]),

      BLANK(),

sum(COLUMN B))

 

 

 

Now obviously the total row is greater than zero so in the column B Total it is doing a sum on ALL of the values in column B.

 

Is there anyway I can amend the formula to allow for the fact Grand Total should only sum what is displayed?

 

Any help will be greatly appreciated.

 

Ta

 

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Debbs1976

     

    Can you share some data and the visual you are expecting.

     

    Cheers

     

    CheenuSing

  • Sean's avatar
    Sean
    Community Champion
    DAX Measure = CALCULATE ( SUM(Table[Column B]), Table[Column A] = BLANK() )
    Or
    DAX Measure = CALCULATE ( SUM(Table[Column B]), Table[Column A] = "" )
  • v-huizhn-msft's avatar
    v-huizhn-msft
    Microsoft Employee

    Debbs1976


    You’d better to add a filter in sum() function when you create a calculation based on your requirement. I create below calculated column using sample data and formula, please review it.

    =IF(ISBLANK(Sale[Sale Date]),BLANK(),CALCULATE(SUM(Sale[Sale ]),ALLEXCEPT(Sale,Sale[Sale Date])))

     

    Best Regards,
    Angelia