Forum Discussion

Rupilas's avatar
Rupilas
New Member
3 years ago
Solved

VAR problem

Hi all,   I am a newby and tried the VAR Function. Has anyone an idea, why it doesnt work?   Thanks a lot   Martin   Sales Summary = VAR SalesTableWithCustKey = Filter(-- Filter Table -- '...
  • Watsky's avatar
    3 years ago

    Hi Rupilas

    It looks like you're commenting everything out. When you use an comment operator everything after the operator becomes a comment. Try using /*  to open and  */ to close the comment instead.

     

    Sales Summary =
    VAR SalesTableWithCustKey = Filter(/* Filter Table */ 'Fact Sale', /* Filter Condition */ 'Fact Sale'[Customer Key]>0)
    VAR SalesTableGrouped = SUMMARIZE(/* Table to Summarize  */ 'SalesTableWithCustKey','Fact Sale'[Customer Key],/* Aggregated Colum Name  Expression */ "Total Spend", SUM('Fact Sale'[Total Including Tax])
    VAR SummaryTableFiltered = TOPN(/* Numbers of rows to return */ 10, /* Table to filter */ SalesTableGrouped, /* Order by Expression */ [Total Spend])
     RETURN SummaryTableFiltered