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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
cyncyn_98
Frequent Visitor

Dax Measure : Column Previous Values

Hello everyone, 

 

I'm having a bit of trouble formulating the right dax measure. I have created a matrix table, that will show data based on a week ending date selected. And within the matrix table, I want to have columns that will show previous week's values. 

I have used the dax measure below, but I get a column with totals, instead of the total by Branch Type. The total value is correct, I just need the column to show the right values by branch type. 

 

Prev Hours = CALCULATE(
    sum('Branch Flash Report'[TempHrs]),
    FILTER(ALL('Branch Flash Report'),'Branch Flash Report'[WeekID] = MAX('Branch Flash Report'[WeekID])-1))

 

cyncyn_98_0-1660678719872.png

Thank you!

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@cyncyn_98 

Please try it this way:

Prev Hours =
VAR __WEEKID =
    MAX ( 'Branch Flash Report'[WeekID] )
RETURN
    CALCULATE (
        SUM ( 'Branch Flash Report'[TempHrs] ),
        'Branch Flash Report'[WeekID] = __WEEKID - 1,
        REMOVEFILTERS ( 'Branch Flash Report'[WeekID] )
    )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@cyncyn_98 

Please try it this way:

Prev Hours =
VAR __WEEKID =
    MAX ( 'Branch Flash Report'[WeekID] )
RETURN
    CALCULATE (
        SUM ( 'Branch Flash Report'[TempHrs] ),
        'Branch Flash Report'[WeekID] = __WEEKID - 1,
        REMOVEFILTERS ( 'Branch Flash Report'[WeekID] )
    )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thank you @Fowmy ! That worked 😊

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.