Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
When creating a Calculate function with SAMEPERIODLASTYEAR Power BI returns the same values as the current period when using a custom YEAR-MONTH hierarchy.
As a measure I use Verkoopwaarde SPLY = CALCULATE(SUM(Sales[Sales]),SAMEPERIODLASTYEAR(Date[DATUM].[Date]))
When I create the same measure with the date column (Power BI then creates its own hierarchy) the correct values are returned.
How is this possible? Any Ideas?
@Anonymous
When using SAMEPERIODLASTYEAR function, you must use a date column with contigous, unique date values. It can't evalute expression like [column].[Date] as contigous dates. So please always directly put the date column in any time intelligence function.
Regards,
I guess since SAMEPERIODLASTYEAR function requires a column containing dates. When you use the date column in your Date Table to do the calculation, you need to use the same date key column or hierarchy in the Date table to visual to show the correct data.