Forum Discussion

Yrstruly2021's avatar
Yrstruly2021
Icon for Helper V rankHelper V
4 years ago

All DAX calculations gives an error

Please assist. I tried to do calculations and it gives an error for all of them.

I chnages the following DAX code to what i have in my tables:

Margins LQ = CALCULATE( [Profit Margins], DATEADD( Dates[Date], -1, QUARTER ) )
QoQ Sales Change = [Total Sales] - [Sales LQ]
Sales 1M MA =
AVERAGEX(
    DATESINPERIOD( Dates[Date], LASTDATE( Dates[Date] ), -1, MONTH ),
        [Total Sales] ) and
 
Cummulative Sales =
CALCULATE( [Total Sales],
    FILTER( ALLSELECTED( Dates ),
        Dates[Date] <= MAX( Dates[Date] )))
 

4 Replies

    • tamerj1's avatar
      tamerj1
      Icon for Community Champion rankCommunity Champion

      Hi Yrstruly2021 

      https://we.tl/t-wvUyhckJ9W
      The orders Created_DateTime column contains time in addition to date. Therefore, it matches zero dates in the calendar table. I have created a Created_Date column and linked it with Calendar[Date] and now your measure works. However, I noticed that the year slicer still have blanks, so I adjusted the start date of the calendar table to MIN ( Orders[Create_Date] ) but still have blanks. I believe your data model and requires an overall check to clean up everything.