Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Measure total not working

So I have the known issue of measure totals not showing, but canfigure out why.

 

The following measure works fine:

New customers over time = 
var test = CALCULATE (
    COUNTROWS (
        FILTER (
            CALCULATETABLE (
                ADDCOLUMNS (
                    VALUES ( Sales[ID] ),
                    "DateOfFirstDeal", CALCULATE ( MIN ( Sales[Won Time]) )
                ),
                ALL ( Dates )
            ),
            CONTAINS ( VALUES ( Dates[Date] ), Dates[Date], [DateOfFirstDeal] )
        )
    ),
    FILTER ( Sales, Sales[Won Time] <> BLANK () )
)
return
test

 However, i then add a filter to my calculate table, and that causes the totals to not show:

New customers over time = 
var test = CALCULATE (
    COUNTROWS (
        FILTER (
            CALCULATETABLE (
                ADDCOLUMNS (
                    VALUES ( Sales[ID] ),
                    "DateOfFirstDeal", CALCULATE ( MIN ( Sales[Won Time]) ,FILTER(Sales,Sales[Lost time]=BLANK()))
                ),
                ALL ( Dates )
            ),
            CONTAINS ( VALUES ( Dates[Date] ), Dates[Date], [DateOfFirstDeal] )
        )
    ),
    FILTER ( Sales, Sales[Won Time] <> BLANK () )
)
return
test

 

Why does this one added filter cause the total to not work?

2 Replies

  • AllisonKennedy's avatar
    AllisonKennedy
    Community Champion

    Anonymous  What is [DateOfFirstDeal]  and what does your data model look like?

    Your measure looks slightly more complex than I think it may need to be, but I'm not sure exactly what you're trying to calculate?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Not very clear. The column total is not only the sum of each column, in fact the column total may also be calculated by measure. It's better to show some sample data and excepted result.

     

    Best Regards,

    Jay