Forum Discussion

Bruno_Soares_25's avatar
Bruno_Soares_25
Frequent Visitor
2 years ago
Solved

Calculated Measure not showing the column total

I've been trying to fix this last week sales for a while and its working on a row basis but as a column its not giving me the total which I need for other measures.

 

Basically i've got this formula

 

Prev Cost =
CALCULATE(
    SUM(table[Cost (EUR)]),
FILTER(
        ALL('table'),
        'table'[Date] < MIN('table'[Date]) &&
        'table'[Date] >= MIN('table'[Date]) - 7
    )
)

 

This is the outcome which on a row to row basis is correct but its not giving me any total column value, I've tried a bunch of things but im pretty new to DAX also so need a buoy 

 

Thanks

 

2 Replies

  • What is your expected result?  Keep in mind that the row totals section will have ALL the selected dates, and therefore your filter will fall off the lower end of the date range, returning nothing.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Bruno_Soares_25 ,

     

    We can create a new measure.

    Measure =
    SUMX ( SUMMARIZE ( 'Table', [Year], [Week], "pre", [Prev Cost] ), [pre] )
    

    Then the result is as follows.

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.