Forum Discussion

devaverma's avatar
devaverma
New Member
1 year ago
Solved

Facing issue with DATEADD function

Hi all, I am a beginnering and try to flow previous year cost using DATEADD function. But, I am not getting the desired results.   I am sharing the screenshot of the result that I am getting. Pleas...
  • Ashish_Mathur's avatar
    1 year ago

    Hi,

    Try this approach

    1. Create a Calendar table with calculated column formulas for Year, Month name and month number
    2. Create a relationship (Many to One and Single) from the Date column of the Fact table to the Date column of the Calendar table
    3. To your visual/filter/slicer, dray Year/Month name from the Calendar table
    4. Write this measure

    Measure = calculate([Cost of logistics],previousmonth(calendar[date]))