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

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.

Reply
CalebG
Frequent Visitor

Separating sales column in to different columns depending on year

Hi, I am currently loading data for sales across last year and this year and want to create a visual that has columns for 2022 and 2023. There is one column for sales right now but I want to split it up so I can compare year over year. Does anyone know how I can achieve this? I was thinking about making two new columns for each year and having nulls in the column for the year it doesn't reference, but I'm not sure this is the best approach. Thanks!

3 REPLIES 3
TomMartens
Super User
Super User

Hey @CalebG ,

 

this is not the best approach, as you are going to convert a table in a long format into a wide format. You can read about this in the article by Hadley Wickham, even if the article does not relate to Power BI or data modeling in Power BI: https://vita.had.co.nz/papers/tidy-data.pdf
You will find an introduction to data modeling in Power BI here: https://learn.microsoft.com/en-us/training/modules/model-data-power-bi/

And finally, this article contains almost everything about date/time related calculations also about YoY (Year over Year) comparisons: https://www.daxpatterns.com/time-patterns/

This seems a lot of reading, but please consider it as an investment into your future Power BI development.

 

Regards,
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Syk
Super User
Super User

Add the year to the other axis or to the legend field. No need to split columns or create dummy rows!

CalebG
Frequent Visitor

Hi Syk! The one issue I forgot to mention is they aren't connected by date. There's weird relationships I had to use due to pulling data from multiple resources but I'll include them below if that's any help. Thanks!

CalebG_0-1686342337212.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.