remove the blank rows in DAX

202 views Asked by At

I have a code as below and I have empty cells in @Rate column. How can I get rid of the blank rows using DAX? Many thanks in advance.

   Sales USD (Daily) :=
    VAR AggregatedSalesInCurrency =
        ADDCOLUMNS (
            SUMMARIZE (
                Sales,
                'Date'[Date],                 -- Day granularity
                'Currency'[Currency]
            ),
            "@SalesAmountInCurrency", [Sales (Internal)],
            "@Rate", CALCULATE (
                SELECTEDVALUE ( 'Daily Exchange Rates'[Rate] )
            )
        )
    VAR Result =

SUMX (
        FILTER(AggregatedSalesInCurrency,  [@Rate] <> 0),
        [@SalesAmountInCurrency] / [@Rate]
    ) 

RETURN
{Result} // in daxstudio use {} 
1

There are 1 answers

3
davidebacci On BEST ANSWER
SUMX (         
   FILTER(AggregatedSalesInCurrency,  [@Rate] <> 0),  
  [@SalesAmountInCurrency] / [@Rate]     
)