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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
skaranam
Frequent Visitor

Week over Week calculations - Previous Week Calculations - Power BI

Hello All,

 

I am working on a power bi report and i have bugsfound for each week. I need to get previousweeknumber and then its bugs so that i can calculate WoW. Below is the summary,

 

Currently i have this

WeekNbr        BugsFound

34                       10

35                       20

36                       30

 

With formula in power bi, i calculated PrevWeekNbr

WeekNbr        BugsFound        PrevWeekNbr

34                       10                           33

35                       20                           34

36                       30                           35

 

What i need is (imagine week 33 bugs are 5)

WeekNbr        BugsFound        PrevWeekNbr   PrevWeekBugs

34                       10                           33                    5

35                       20                           34                   10

36                       30                           35                   20

 

 

I tried different formulas for new measure but did not get lucky. Any ideas ??

1 ACCEPTED SOLUTION

Hi Sai

How about this one:

 

PrevWeeksBugs2 = LOOKUPVALUE(Bugs[BugsFound];Bugs[WeekNbr];Bugs[PrevWeekNbr])+0

 

It is not a very nice solution I admit, someone might provide a better one.

 

JJ

View solution in original post

3 REPLIES 3
DoubleJ
Solution Supplier
Solution Supplier

Hi

 

Creating a colmn with this forumla might help (you might have to replace the semicolons with commas):

PrevWeekBugs = 
SUMX(
    FILTER(
        Bugs;
        Bugs[WeekNbr] = EARLIER(Bugs[PrevWeekNbr])
        )
    ;Bugs[BugsFound]
)+0


WoW.PNG

 

 

Hope this helps

JJ

Hello JJ,

 

Thanks for your quick response and solution

 

I am using directquery models and i think thats the reason i am getting below error while using below logic.

 

Function 'SUMX' is not allowed as part of calculated column DAX expressions on DirectQuery models.

 

Any ideas on this.

 

Thanks,

Sai

Hi Sai

How about this one:

 

PrevWeeksBugs2 = LOOKUPVALUE(Bugs[BugsFound];Bugs[WeekNbr];Bugs[PrevWeekNbr])+0

 

It is not a very nice solution I admit, someone might provide a better one.

 

JJ

Helpful resources

Announcements
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!

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.