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
JBell1979
New Member

Comparing sata sets from 2 years / 2 tables

Hello team. I am trying to compare data from different measures (say sales), so I have 2 tables 2022 and 2021. How can I compare these 2 figures to show a true comp figure?

Thanks in advance for the help

Jeff

1 ACCEPTED SOLUTION
JBell1979
New Member

Y'all rock. We got it covered many thanks for the replies!

View solution in original post

3 REPLIES 3
JBell1979
New Member

Y'all rock. We got it covered many thanks for the replies!

v-kkf-msft
Community Support
Community Support

Hi @JBell1979 ,

 

I am not sure if I understood your question correctly. If you want to compare the sales per month, you can create a Dates table and create the relationship. Then use the [Date.Month], [2021 Sales] and [2022 Sales] in matrix chart. 

 

vkkfmsft_0-1646372601952.png

Screenshot 2022-03-04 134452.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@JBell1979 , Create a date/year table and join with both. Create other common dimension too

 

Try measures like

 

Table having 2022

This Year = CALCULATE(sum('Table1'[Value]), FILTER(ALL('Date'),h'Date'[Year Rank]=max('Date'[Year Rank])))

 

Table having 2021
Last Year = CALCULATE(sum('Table2'[Value]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1))

 

You need select 2022 or should have 2022 as max

 

This year Today =
CALCULATE(sum('Table1'[Qty]), FILTER('Date',year('Date'[Date] )= year(today()) ) )

 

 

Last year Today =
CALCULATE(sum('Table2'[Qty]), FILTER('Date',year('Date'[Date] )= year(today()) -1) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.