Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Team,
Am creating new measures based on year column.
Measure 1:
Solved! Go to Solution.
Hi @Anonymous ,
SAMEPERIODLASTYEAR takes date column as input, but you are just giving it year part of your date.
Check details here:
https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax
Thanks,
Pragati
Hi @Anonymous
The error detail has shown the reason, 'Sales Data'[Year] is not Date type.
Is 'Sales Data'[Year] a Whole number type column with values like 2020, 2021?
Try to update your measure as below.
PY Revenue = CALCULATE([CY Revenue],Filter(All(Sales Data),'Sales Data'[Year] = MAX('Sales Data'[Year])-1))
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for response.
Have converting datetime field into year in SQL like bellow.
YEAR([Order Date]) [Year]
Hi @Anonymous ,
SAMEPERIODLASTYEAR takes date column as input, but you are just giving it year part of your date.
Check details here:
https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax
Thanks,
Pragati
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |