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
JST15
Helper I
Helper I

Annualizing Data to Include in Matrix Table with History

Hi very smart folks!

I have an underlying set of data that includes five years of historic data for volume. My boss wants a simply matrix table that shows volume by year plus a few other metrics. The volume data includes transactions through today. Here's my issue. He wants the 2024 volume to be annualized using the actuals through October (YTD-October/10*12). The screenshot below shows the view and the 2024 amount (707) which is volume through today. Creating a measure to use in a card is easy. How can I manipulate the data table or below matrix to annualize the 2024 amount? Plus have it seamlessly incorporated into the matrix table. Essentially, it looks just like the below table but the 707 is annualized so the final amount is 848. Or any suggestions folks have. I greatly appreciate the help!

 

Side question: If you can calculate off a table, would I be able to add a CAGR to the below matrix and show it under the 2024 row? This community is the best, thank you!!

 

JST15_0-1731365602799.png

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

hI @JST15 

To evaluate calculation by year and sum them up, use SUMX on a virtual table.

My Measure =
VAR MaxYear =
    CALCULATE ( MAX ( Dates[Year] ), ALLSELECTED ( Dates ) ) // Finds the max year in the Dates table based on current selection, use ALL to ignore slicer selections/filters on Dates
VAR MaxMonthNumber =
    MONTH ( CALCULATE ( MAX ( Dates[Date] ), ALLSELECTED ( Dates ) ) ) // Finds the month number of the max date in the Dates table based on current selection
RETURN
    SUMX (
        ADDCOLUMNS (
            SUMMARIZE ( Fact, Fact[Year] ),
            "@qty",
                IF (
                    Fact[Year] = MaxYear,
                    DIVIDE ( [Qty Measure], MaxMonthNumber ) * 12,
                    [Qty Measure]
                )
        ),
        [@qty]
    )




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

6 REPLIES 6
danextian
Super User
Super User

hI @JST15 

To evaluate calculation by year and sum them up, use SUMX on a virtual table.

My Measure =
VAR MaxYear =
    CALCULATE ( MAX ( Dates[Year] ), ALLSELECTED ( Dates ) ) // Finds the max year in the Dates table based on current selection, use ALL to ignore slicer selections/filters on Dates
VAR MaxMonthNumber =
    MONTH ( CALCULATE ( MAX ( Dates[Date] ), ALLSELECTED ( Dates ) ) ) // Finds the month number of the max date in the Dates table based on current selection
RETURN
    SUMX (
        ADDCOLUMNS (
            SUMMARIZE ( Fact, Fact[Year] ),
            "@qty",
                IF (
                    Fact[Year] = MaxYear,
                    DIVIDE ( [Qty Measure], MaxMonthNumber ) * 12,
                    [Qty Measure]
                )
        ),
        [@qty]
    )




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian . Thank you for the reply! I think my inexperience with Power BI is getting in my own way, as I can't get your solution to work. Though I think it's the one I'm looking for. When recreating your code for my work I get an error "The expression specified in the query is not a valid table expression". Any ideas what i'm doing wroing? I admit, I've never worked in a virtual table before so I've been reading up on them. Seem super helpful. Once I get it working, you're saying I can get an output that looks like the cutout I provided but shows the 2024 value as annualized? 

Annualized = 
 VAR MaxYear = CALCULATE(MAX('Calendar'[Year]),ALLSELECTED('Calendar'))
 VAR MaxMonthNumber = MONTH(CALCULATE(MAX('Calendar'[Date]),ALLSELECTED('Calendar')))

 RETURN
 SUMX(
    ADDCOLUMNS(
        SUMMARIZE('Data Table','Data Table'[PERIOD_YEAR]),
        "Qty",
        IF('Data Table'[PERIOD_YEAR]=MaxYear,
        DIVIDE([Total Quantity],MaxMonthNumber)*12,
        [Total Quantity]        
        )
    ),
    [Qty]
 )

 

Hi @JST15 

 

Are you trying to create a calculated table? SUMX returns a scalar value which is not a valid a table. That is supposed to be inputed as a measure. Add th year from your calendar table to a viz and then add this measure.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

It's wortking. Thank you again!!!

Bibiano_Geraldo
Super User
Super User

Hi @JST15 , please try the following DAX:

 

1- Annualizing the 2024

AnnualizedVolume2024 = 
VAR YTDVolume = CALCULATE(SUM(YourTable[Volume]), YourTable[Year] = 2024)
RETURN (YTDVolume / 10) * 12

 

2. Create a CAGR measure

CAGR = 
VAR StartValue = CALCULATE(SUM(YourTable[Volume]), YourTable[Year] = 2019)
VAR EndValue = [AnnualizedVolume2024]
VAR Years = 2024 - 2019
RETURN ( (EndValue / StartValue) ^ (1 / Years) ) - 1

 

I hope this help you, if yes, please give kudo and mark as solution.

 

Thank you

JST15
Helper I
Helper I

Sorry, the volume amount of 707 in the table is the amount through October and not through today like I said in the original post. 

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.