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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Comparing dates, current year months with 2019 same months

I have monthly data from few years and i need to compare this years months with selected year for e.g. 
2023/1 with 2019/1
and so on until i reach the maximum months that i have of current year, right now i have until 2023 august

7 REPLIES 7
Anonymous
Not applicable

in your pbi result is 

Zygis123_0-1699854230034.png

when i put my data in i get 

Zygis123_1-1699854257960.png


you get 8 months i get 12

 

pls try this code

Screenshot_6.png

Ahmedx
Super User
Super User

pls try

 

Anonymous
Not applicable

Zygis123_0-1699849240090.png

how does it work? if i select sales and months should it be all 12? sales is just sum(data[value]) why it calculates just the 8?

Is this what you are looking for?

Screenshot_2.png

Anonymous
Not applicable

Zygis123_0-1699853685558.png

i get the right year but too many months

 

 

what do many months mean?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors