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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Isildur13
Frequent Visitor

Calculate total on each row based on year

Hi Community

 

I need help with calculating the total amount for the whole year and display it on the rows in my table. I have no date table since the data only includes a year column.

 

I have tried to do the following in DAX:

$ Total Amount Year =
    CALCULATE (
        [$ Amount],
        FILTER (
            ALLSELECTED(  'Periode'[Year]),
            [Year] = Periode[Year]
        )
    )

 

 

But it still filters out the amount on each rows instead of showing the total for the year. Is it possible to do without a date table? 

 

Isildur13_0-1706086272931.png

 

1 ACCEPTED SOLUTION

@Isildur13 

try this : 

$ Total Amount last Year =
var  last_year =  max( period[year])   - 1 
    CALCULATE (
        [$ Amount],
        all( table_name), 
period([year]) = last_year
    )
 
 
 
 
 
 
 
 
If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that  thumbs up button 🫡👍

View solution in original post

4 REPLIES 4
Daniel29195
Super User
Super User

@Isildur13 

 

$ Total Amount Year =
    CALCULATE (
        [$ Amount],
        allexcept( table_name ,   Periode[Year] ) 
    )
 
 
or : 

 
$ Total Amount Year =
    CALCULATE (
        [$ Amount],
        all( table_name), 
values ( period[year])  
    )
 
 
 
If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that  thumbs up button 🫡👍
 

Hi @Daniel29195 

 

It worked! 

I went with the second solution and added one more values field.

 

I have one more question:

Is it possible to add another measure where the totals just calculated is shown like a last year? So the total amount year for category A 2020 367.75 would be displayed on category A 2021 instead?

 

Isildur13_0-1706102054445.png

 

@Isildur13 

try this : 

$ Total Amount last Year =
var  last_year =  max( period[year])   - 1 
    CALCULATE (
        [$ Amount],
        all( table_name), 
period([year]) = last_year
    )
 
 
 
 
 
 
 
 
If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that  thumbs up button 🫡👍

Hi @Isildur13 ,

 

This should be what you're looking for. Feel free to provide more details about your specific scenario if you desire a different outcome.





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.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.