Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Pravallika-gadd
New Member

Line chart

Hi 

In line chart I want to show current year vs previous year but in my case current year we are in june means current year value is showing upto june and for year 2023 also showing upto june 2023 it is not showing upto jan to Dec in 2023 

Could anyone help me on this what might be the reason?

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_1-1720464460064.png

 

 

Jihwan_Kim_0-1720464447428.png

 

Sales current year: = 
SUM(sales[sales])

 

Sales previous year: = 
CALCULATE ( [Sales current year:], SAMEPERIODLASTYEAR ( calendar_dim[Date] ) )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
foodd
Super User
Super User

Hello @Pravallika-gadd , thank you for sharing a question with the Community.  This reply is informational. Please follow the decorum of the Community Forum when asking a question.

Please share your work-in-progress Power BI Desktop file (with sensitive information removed) and any source files in Excel format that fully address your issue or question in a usable format (not as a screenshot). You can upload these files to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then provide the file's URL.

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

 

If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.  Proud to be a Super User!

Thank you , for solution but I don't have calender table am taking the shipdate column from delivery table same shipdate only am using in the formula for current year and previous  year

Anonymous
Not applicable

Hi,@Pravallika-gadd 

Has the problem been solved? If it's solved, share your solution and accept it as a solution, which will help members of the community who have the same problem as you find a solution faster.

 

If not, please share your data.I would be grateful if you could provide me with the pbix file or sample data.Remember to remove sensitive data .

 

If you have any other questions please feel free to contact me.

 

Best Regards,

Leroy Lu

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.