Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Experts,
I need to calculate the last year same period sales in a calculated measure.
Here, the 1 period = 4 weeks and hence there are 13 periods in an year.
Here is the table where Period format and Sales are given. Column 3(Required Measure) needs to be calculate:
Period | Sales | Required Measure |
2021P01 | 100 | |
2021P02 | 200 | |
2021P03 | 300 | |
2021P04 | 400 | |
2021P05 | 500 | |
2022P01 | 600 | 100 |
2022P02 | 700 | 200 |
2022P03 | 800 | 300 |
2022P04 | 900 | 400 |
2022P05 | 1000 | 500 |
Thanks in advance !
Solved! Go to Solution.
Hi,
1- create Dim Date with using the below script :
3- In the main table, create Measure for calculated the last year sales amount :
Hi,
In your Date dim, add the below column :
Hi @MahyarTF ,
Created calculated as you suggested and mapped to the main table but didn't work. The values were only returned for the last period and that too were quite weird values.
Hi,
1- create Dim Date with using the below script :
3- In the main table, create Measure for calculated the last year sales amount :
@atult if you can have year column seperately,
then you can use this dax to get py sales.
Accept the solution if it works for you.
Hi @Anonymous ,
It didn't work for me. Are you creating a calculated column or measure for this?
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
65 | |
64 | |
56 | |
39 | |
27 |
User | Count |
---|---|
85 | |
59 | |
45 | |
43 | |
38 |