Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi everyone
I want to sum the stock value before 2 years from the selected year , for example if the selected year is 2024 i want to get stock in 2022 and if the selected year is 2023 I want to get 2021 value and so on
I useed these measures to calculate the selected year and last year
this yearstock =
last yearstock =
Solved! Go to Solution.
Hi @Wadda7AboUdai ,
Thanks for reaching out!
I understand you want ignore the filtering of the month. My workaround is to create a separate table contains years.
I've created a sample for your reference:
Sample data:
1.Create a separate year table.
2.Create a measure to return previous data and ignore month filtering.
Previousyear = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),YEAR([Date])=SELECTEDVALUE('Table (2)'[Year])-1))
Thisyear:
Thisyear=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),YEAR([Date])=SELECTEDVALUE('Table (2)'[Year])))
You can check more details by downloading the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Wadda7AboUdai ,
Thanks for reaching out!
I understand you want ignore the filtering of the month. My workaround is to create a separate table contains years.
I've created a sample for your reference:
Sample data:
1.Create a separate year table.
2.Create a measure to return previous data and ignore month filtering.
Previousyear = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),YEAR([Date])=SELECTEDVALUE('Table (2)'[Year])-1))
Thisyear:
Thisyear=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),YEAR([Date])=SELECTEDVALUE('Table (2)'[Year])))
You can check more details by downloading the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
20 | |
14 | |
11 | |
8 | |
6 |
User | Count |
---|---|
23 | |
23 | |
20 | |
15 | |
10 |