Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Dear community,
I have a question regarding time intelligence function issue. I'd like to create a measure of Total Orders - Last Year using SAMEPERIODLASTYEAR().
After I test and check the output of Year = 2014, it turns out that the Last Year value isn't blank as I expected. Instead of displaying last year result, It shows the same value with Total Orders - Current Year.
I have checked my calendar table and it has already marked as a date table. Do you know what makes the function not working properly? Please let me know if there anything I missed here. Thank you!
https://drive.google.com/file/d/1ivQuyeNZpC6gAAmVrGNhJ9znajy_0wPn/view?usp=sharing
Solved! Go to Solution.
hi @Morran ,
a VAR is a fixed value once it is defined. try like:
Total Orders - LY 2 =
CALCULATE(
DISTINCTCOUNT(Orders[Order ID]),
SAMEPERIODLASTYEAR(
'Calendar Table'[Date]
)
)+0
it worked like:
hi @Morran ,
a VAR is a fixed value once it is defined. try like:
Total Orders - LY 2 =
CALCULATE(
DISTINCTCOUNT(Orders[Order ID]),
SAMEPERIODLASTYEAR(
'Calendar Table'[Date]
)
)+0
it worked like:
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |