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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
phanimusunuri9
Frequent Visitor

Week over Week Comparison

Hi All,

 

I am trying to compare "Monday Last week's Sales" with "Monday this week's Sales". To be precise, if today is 'Monday' i want to compare it with last 'Monday', if 'Tuesday then last week 'Tuesday'. so on..

 

Sales last Monday = 2,450

Sales this Monday = 2,360

 

Difrerence = 90 (3.6%)

 

Is there a way to do this as a 'Measure', i want this in KPI visual.

1 ACCEPTED SOLUTION

@phanimusunuri9

 

You should have Year, Week Number and Weekday columns in your table. Or you can generate with calculated column. 

 

 

WeekNumber = WEEKNUM(Table[Date],2)
WeekDay = WEEKDAY(Table[Date],2)

Then you can create a measure like: 

 

 

 

Difference =
SUM ( Table[Sales] )
    - CALCULATE (
        SUM ( Table[Sales] ),
        FILTER (
            ALL ( Table ),
            Table[Year] = MAX ( Table[Year] )
                && Table[WeekNumber]
                    = MAX ( Table[WeekNumber] ) - 1
                && Table[WeekDay] = MAX ( Table[WeekDay] )
        )
    )

Regards,

View solution in original post

15 REPLIES 15
mase_53
New Member

Hi @Ashish_Mathur @phanimusunuri9 @Anonymous @jcabeza is there a way to use this solution - when my Year, Week Number and Weekday columns live in another table (dim_dates) but have an active relationship with the date in the table containing sales? Would appreciate your help!

Hi,

Share some data, describe the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

 

Share a snapshot of your data.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

 

Can you please assist me in calculating last week vs current week comparison in power bi +-

Hi,

Share some data and show the expected result.  More importantly, in the Calendar table, please show a column with the week numbers.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Share your email id, i will share pbix with you 

Hi,

Upload the file to Google Drive and shre the download link here.  In the Calendar Table, please enusre that you have a week number column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

 

i need rolling six week vs current week option in slicer and my week starts from friday to thursday 

it should exclude the current week and take respective weeks for rolling 6 weeks

Eg - i have data from Wk.1 to Wk.6 and wk.7 has only  4  days data and i am in 5th day so rolling 6 week would be Wk.1 (Friday) to Wk.6(Thursday) and current Week would have Wk.7 Friday till today-1

 

could you please assist me in getting this columns in power bi

phanimusunuri9
Frequent Visitor

Hi All,

 

I am trying to compare "Monday Last week's Sales" with "Monday this week's Sales". To be precise, if today is 'Monday' i want to compare it with last 'Monday', if 'Tuesday then last week 'Tuesday'. so on..

 

Sales last Monday = 2,450

Sales this Monday = 2,360

 

Difrerence = 90 (3.6%)

 

Is there a way to do this as a 'Measure', i want this in KPI visual.

 

 

 

@phanimusunuri9

 

You should have Year, Week Number and Weekday columns in your table. Or you can generate with calculated column. 

 

 

WeekNumber = WEEKNUM(Table[Date],2)
WeekDay = WEEKDAY(Table[Date],2)

Then you can create a measure like: 

 

 

 

Difference =
SUM ( Table[Sales] )
    - CALCULATE (
        SUM ( Table[Sales] ),
        FILTER (
            ALL ( Table ),
            Table[Year] = MAX ( Table[Year] )
                && Table[WeekNumber]
                    = MAX ( Table[WeekNumber] ) - 1
                && Table[WeekDay] = MAX ( Table[WeekDay] )
        )
    )

Regards,

I have a large amount of data because of that i cant use this. can you help me how to compare without dax.

This works great! until I try to filter based on a category field.  Is there a way to add a dynamic filter so that this works for each "sales" category?

I've been looking for for so long, thanks.

Anonymous
Not applicable

Hi Guys,

I am trying to calculate the week by week comparison of the total Number of Jobs from Previous week to current week & % change.

 

 I have Year, Week num, Num of jobs from the Data set, what measure do i use here?

 

i tried to use the above measure, but did not work for me as it is $ Sales & on my report i do not require $sales.

 

thanks for your help here.

 

I have problems when i have change of the year

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.