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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Jennynz
Regular Visitor

YoY variance for completed months

Hi,

 

I'm very new to the DAX world, so apologies in advance if I'm not wording my question in the best way.

 

I have a report that shows revenue by person and month for various years. Below is a mock up of what I'm working with. 

I need to create a measure at the end of the matrix visual to show YoY variance for completed months (column P). i.e. Jan-Jul 2023 seeing as we haven't completed the month of August. 

Jennynz_0-1691465348495.png

I have been able to create 2 measures to work the current year's YoY variance -
the first measure looks up whether the month is a completed month this year:

IsCurrentYearMonth =
IF(
    AND(
        YEAR([Invoice Date].[Date]) = YEAR(TODAY()), 
        [Invoice Date].[Date] <= EOMONTH(TODAY(), -1)    
    ),
    1
    0  
)
 
And then another to pull current year revenue:
CurrentYTDRevenue =
CALCULATE(
    SUM('*JobBIlling'[Invoice Amount]),
    FILTER(ALL('*JobBIlling'[Invoice Date].[Date]),
    [IsCurrentYearMonth]=1
    ))
 
What I need is for the YoY variance to work for previous years. I.e. in 2022 the YoY variance shows the variance between 2022 and 2021.
 
Is anyone able to point me in the right direction?
TIA!
1 REPLY 1
johnt75
Super User
Super User

Create a proper date table, there's plenty of articles and videos on doing that, and link it to your fact table. Then you can create a measure like

YTD Revenue YoY =
VAR ThisYear =
    DATESBETWEEN (
        'Date'[Date],
        DATE ( YEAR ( TODAY () ), 1, 1 ),
        EOMONTH ( TODAY (), -1 )
    )
VAR ThisYearRevenue =
    CALCULATE ( SUM ( '*JobBIlling'[Invoice Amount] ), ThisYear )
VAR LastYearRevenue =
    CALCULATE (
        SUM ( '*JobBIlling'[Invoice Amount] ),
        DATEADD ( ThisYear, -1, YEAR )
    )
VAR Result =
    DIVIDE ( ThisYearRevenue - LastYearRevenue, LastYearRevenue )
RETURN
    Result

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.