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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ansu8371
Regular Visitor

how to filter current year sales and the last year sales for the same quarter

Hello,
If we have such data, how can we compare the sales for two years like current year and last year in power bi visual? For example if we choose Q3-2023, it should show the two years sales like current year (Q3-2023) and last year (Q3-2022) and vice versa, how can it be possible? Thank you.

YearQtrQQ-YYYYSales
2021Q1Q1-202188
2021Q2Q2-202175
2021Q3Q3-202166
2021Q4Q4-202185
2022Q1Q1-202291
2022Q2Q2-202270
2022Q3Q3-202299
2022Q4Q4-202280
2023Q1Q1-202393
2023Q2Q2-202391
2023Q3Q3-202388
2023Q4Q4-2023110
2024Q1Q1-202496
2024Q2Q2-202489
2024Q3Q3-2024106
2024Q4Q4-202498
1 ACCEPTED SOLUTION
adudani
Super User
Super User

hi @Ansu8371 ,

 

  • I converted the fact table in the model to have a daily date field ( Dates are required for time intelligence)
  • I added a date dimension.
  • Created 2 measures, 1 for sales. 1 for sales LY using Dateadd.

 

please see the solution here: https://drive.google.com/file/d/1SwhwghnmfIr649fp8VoNuXuT_ZrXJ8l-/view?usp=drive_link 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

View solution in original post

1 REPLY 1
adudani
Super User
Super User

hi @Ansu8371 ,

 

  • I converted the fact table in the model to have a daily date field ( Dates are required for time intelligence)
  • I added a date dimension.
  • Created 2 measures, 1 for sales. 1 for sales LY using Dateadd.

 

please see the solution here: https://drive.google.com/file/d/1SwhwghnmfIr649fp8VoNuXuT_ZrXJ8l-/view?usp=drive_link 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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