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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi All,
I am trying to do something in DAX that I can easily do with Excel (show value as difference from previous "x"). In this case, I have a column of Week Numbers with their respective Widget Counts for that week number. In Excel, I can drop into the pivot table and ask it to show me the value difference from the previous week number (regardless of whether it's a date or not). Image below:
I tried something to the effect of:
Solved! Go to Solution.
@lfrosales add following measure
WoW Widget = VAR __prevWeek = MAX( Table1[Week] ) - 1 VAR __thisWeekWidget = SUM( Table1[Widgets] ) VAR __prevWeekWidget = CALCULATE( SUM( Table1[Widgets] ), Table1[Week] = __prevWeek ) RETURN __thisWeekWidget - __prevWeekWidget
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@lfrosales add following measure
WoW Widget = VAR __prevWeek = MAX( Table1[Week] ) - 1 VAR __thisWeekWidget = SUM( Table1[Widgets] ) VAR __prevWeekWidget = CALCULATE( SUM( Table1[Widgets] ), Table1[Week] = __prevWeek ) RETURN __thisWeekWidget - __prevWeekWidget
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thank you so much! I was struggling a couple hours on something that seemed super straightforward and you proved that it was! In my delirium, I accidentally tried adding it as a calculated column and wasn't having any luck, then I realized that you said as a measure! Worked like a charm! The only quirk I will try to work out is that it looks at week 1 of the year and gives it a value equal to that week's widget count. I will try to figure out a way to tell it to ignore Week 1 and continue with the rest.
See below:
User | Count |
---|---|
15 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
29 | |
17 | |
11 | |
7 | |
5 |