Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a bar chart that shows Revenue by Years. By default it shows data for all years. I need to show the bars for Current year+2, ie, suppose current year is 2020, bar should only show for 2020, 2021 and 2022.
How do i achieve this?
Solved! Go to Solution.
Hi @anileshknpowerb ,
We can create two measures to meet your requirement, one calculates the next year value, another calculates the next two years value.
Next_year = CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),'Table'[Year] = MAX('Table'[Year])+1))
Next two year = CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),'Table'[Year] = MAX('Table'[Year])+2))
If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data or describe the fields of each tables and the relations between tables simply?
It will be helpful if you can show us the exact expected result based on the tables.
Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @anileshknpowerb ,
How about the result after you follow the suggestions mentioned in my original post?
Could you please provide more details or expected result about it If it doesn't meet your requirement?
If you've fixed the issue on your own please kindly share your solution.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @anileshknpowerb ,
We can create two measures to meet your requirement, one calculates the next year value, another calculates the next two years value.
Next_year = CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),'Table'[Year] = MAX('Table'[Year])+1))
Next two year = CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),'Table'[Year] = MAX('Table'[Year])+2))
If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data or describe the fields of each tables and the relations between tables simply?
It will be helpful if you can show us the exact expected result based on the tables.
Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Nice!
Proud to be a Super User!
Do you have a date table?
Test out adding a calculated column into your date table that gives a identifies the current year and the following two years and you can apply that as a filter on the visual.
Proud to be a Super User!
@anileshknpowerb you can use relative date filtering
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |