Forum Discussion

kuro_light's avatar
kuro_light
Regular Visitor
4 years ago

SAMEPERIODLASTYEAR not working on Calculated column

Prev_year= VAR py=CALCULATE(SUM('Data'[Value]),SAMEPERIODLASTYEAR('Data'[Date].[Date]))

RETURN py

The formula works on  a measure but returns nulls on a calculated column .I am trying to create a column and get the value for each row not aggregated.

1 Reply

  • v-xiaotang's avatar
    v-xiaotang
    Icon for Community Support rankCommunity Support

    Hi kuro_light 

    Thanks for reaching out to us.

    Please provide your sample data, its expected result, and its calculation formula if necessary. Based on these, I can provide a valid measure. The expected results you provide will help me to check if my measure is correct. Thanks.

     

     

    Best Regards,

    Community Support Team _Tang

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