Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
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!
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
Add the year to the other axis or to the legend field. No need to split columns or create dummy rows!
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!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 38 | |
| 31 | |
| 27 | |
| 27 |