The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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
User | Count |
---|---|
63 | |
56 | |
54 | |
51 | |
31 |
User | Count |
---|---|
180 | |
88 | |
70 | |
46 | |
43 |