Menu
Stuff by Yuki
  • Home
  • Python
  • Power BI
  • Tableau
  • Community
    • Makeover Monday
    • Workout Wednesday
  • About
  • Contact
Stuff by Yuki

Year-Over-Year Calculation: Time Intelligence in Power BI

Posted on May 28, 2021September 28, 2022

Year-Over-Year Calculation With SAMEPERIODLASTYEAR

I worked on this as part of WoW 2021 Week21. I had so much fun working on this project! Not necessarily figuring out how to do Year-over-year calculations because they are made pretty easy to implement in DAX.

I thought about the design and story I wanted to tell the audience, so I customized the design a lot and tried to be creative so that the audience may better understand the trends shown in the visualization.

Here’s a Year-over-year calculation in DAX:

Connecticut Median Sale Price YoY =
VAR _samePeriodLastYear =
    CALCULATE (
        [Connecticut Median Sale Price],
        SAMEPERIODLASTYEAR ( DateDim[Date] )
    )
VAR _diff = [Connecticut Median Sale Price] - _samePeriodLastYear
RETURN
    DIVIDE ( _diff, _samePeriodLastYear )

And I also created a measure that changes color conditionally:

Color for % Diff =
IF ( [% Difference from National Median Sale Price] < 0, "#E6E6E6", "#08519C" )

Designing visuals and creating DAX measures are the funnest part of the job 😎

Data Source | Source Code

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • What are Power BI Dataflows?
  • Calculate the Max Sales Amount for Product
  • Convert DataFrame to Series in Polars
  • Pandas vs Polars – Speed Comparison
  • Polars with DuckDB – Using SQL in Polars

Popular Posts

  • A Running Total Calculation with Quick Measure in Power BI
  • How To Copy And Paste Report Page in Power BI
  • Year-Over-Year Calculation: Time Intelligence in Power BI
  • How to Fill Dates Between Start Date and End Date in Power BI (Power Query)
  • Network Visualizations in Python

connect with me

  • LinkedIn
  • Twitter
  • Github
©2023 Stuff by Yuki | Powered by SuperbThemes & WordPress