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
qwaiti27231
Helper III
Helper III

week on week

i need the dax formula for week on week

 

for eg 

 

count of order Id with 10/9/2017- count of order with 3/9/2017)/count Of order in 3/9/2017

For eg

 count of order at 3/9/2017= 32 count of order in 10/9/2017 =52

 

((52-32)/32)*100=62.50%

 

 

1 ACCEPTED SOLUTION

@qwaiti27231

 

You can create a measure like below:

 

7 days ago value = CALCULATE(SUM(Table5[Value]),FILTER(ALL(Table5),Table5[Date]=MAX(Table5[Date])-7))

55.PNG

 

66.PNG

 

Regards,

View solution in original post

8 REPLIES 8
v-sihou-msft
Microsoft Employee
Microsoft Employee

@qwaiti27231

 

In this scenario, you must have a Year column and a Week Number column in your table. To compare the current week and previous week. You can create a measure like below:

 

 

=
VAR CurrentWeekCountID =
    CALCULATE (
        COUNTA ( Table[ID] ),
        ALLEXCEPT ( Table, Table[Year], Table[WeekNumber] )
    )
VAR PreviousWeekCountID =
    CALCULATE (
        COUNTA ( Table[ID] ),
        FILTER (
            ALL ( Table ),
            Table[Year] = MAX ( Table[Year] )
                && Table[WeekNumber]
                    = MAX ( Table[WeekNumber] ) - 1
        ),
        ALLEXCEPT ( Table, Table[Year], Table[WeekNumber] )
    )
RETURN
    ( CurrentWeekCountID - PreviousWeekCountID )
        / PreviousWeekCountID

If you still have any question, please share some sample data.

 

Regards,

 

should i make week based on year or day???

@v-sihou-msft it doesnt work

@qwaiti27231

 

Can you share some sample data?

@qwaiti27231

 

You can create a measure like below:

 

7 days ago value = CALCULATE(SUM(Table5[Value]),FILTER(ALL(Table5),Table5[Date]=MAX(Table5[Date])-7))

55.PNG

 

66.PNG

 

Regards,

@v-sihou-msft is there any way i can contact  you...Requesting  ur help in many other queries....just joined as BI developer..would appreciate ur help

qwaiti27231
Helper III
Helper III

please mention count of order ID in dax formula

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.