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.
Hello,
I have a large dataset from a large retailer I'll call "World Mart." I need to calculate the week-to-week difference (% Change).
The data provides everything you see below (and then some).
I need to be able to compare one walmart week with the previous one. Unfortunately, I'm stuck, as I'm having difficulty summing the days into weeks while also sticking EXACTLY to that item and store.
I can create date tables, and I have already made a custom column with the WM Week - 1 (to show previous week.
I need to be able to show the % change, week by week.
If someone could point me to a way where I can do this, I'd be appreciative. Even if you can get me to the point where I can create a shifted column called "POS SALES US DOLLARS LAST WEEK" I'd be happy.
Thank you
Solved! Go to Solution.
Hi @jlankford,
I assume your information has all the weeks in the year try something like:
PW = VAR previous_week = MAX ( 'Fact'[WM Week] ) RETURN DIVIDE ( CALCULATE ( SUM ( 'Fact'[POS] ); 'Fact'[WM Week] = previous_week - 1 ) - SUM ( 'Fact'[POS] ); SUM ( 'Fact'[POS] ) )
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @jlankford,
I assume your information has all the weeks in the year try something like:
PW = VAR previous_week = MAX ( 'Fact'[WM Week] ) RETURN DIVIDE ( CALCULATE ( SUM ( 'Fact'[POS] ); 'Fact'[WM Week] = previous_week - 1 ) - SUM ( 'Fact'[POS] ); SUM ( 'Fact'[POS] ) )
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi MFelix,
Thank you very much! That worked. As it turns out, I was very close, but I was confusing a few columns (we have these columns in several currencies). I'm embarrassed that the solution was so simple.
I appreciate the help, and I'm discovering that after nearly a year of working with DAX and M, I'm learning a lot of valuable ways to look at data.
All the best!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |