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
Junaid11
Helper V
Helper V

WOW Week over week change based on multiple slicer selection not working

Hello,
I have below data. I want to do Week over week % change and using below formulas: I have creted the mesuare with date table as well as single table but when I use slicer of Event or type it does not filter. If I make multiple selection in the slicer then it doesn ot work even. 

VisitsRevenueDateEventType
                45$345Nov 3, 2022 HolidaySocial
                34$6Nov 10, 2022 Black FridayWeb
                   7$56Nov 10, 2022 HolidayWeb
                   5$567Nov 17, 2022 Black FridaySocial
                   5$34Nov 17, 2022 HolidayWeb
                23$4,757Nov 24, 2022 Black FridaySocial
              456$457Nov 24, 2022 Cyber WeekWeb
                45$34Nov 24, 2022 HolidaySocial
                76$567Dec 1, 2022 Warehouse BlowoutSocial
              768$7Dec 1, 2022 HolidaySocial
                45$456Dec 8, 2022 HolidayWeb
                90$567Dec 15, 2022 HolidaySocial
                54$45Dec 22, 2022 Boxing WeekWeb
                   4$23Dec 22, 2022 HolidayWeb

new Created columns are:
Week Start date = 'Table'[Date]+-1*WEEKDAY('Table'[Date],2)+1
Week End date = 'v'[Date]+ 7-1*WEEKDAY('Table'[Date],2)
Week Rank = RANKX(all('Date'),'Table'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Table'[Year Week],,ASC,Dense) //YYYYWW format

 

measures
This Week = CALCULATE(sum('Table'[Visits]), FILTER(ALL('Table'),'Table'[Week Rank]=max('Table'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Visits]), FILTER(ALL('Table'),'Table'[Week Rank]=max('Table'[Week Rank])-1))
WOW = (This Week-Last Week)/Last Week

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @Junaid11 

You can create a new column in table:

Weeknum = WEEKNUM('Table'[Date],2)

then create a measure

Measure = var _thisweek=SUMX(FILTER(ALLSELECTED('Table'),[Weeknum]=MAX([Weeknum])),[Visits])
var _lastweek=SUMX(FILTER(ALLSELECTED('Table'),[Weeknum]=MAX([Weeknum])-1),[Visits])
return DIVIDE(_thisweek-_lastweek,_lastweek)

vxinruzhumsft_0-1672905609020.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xinruzhu-msft
Community Support
Community Support

Hi @Junaid11 

You can create a new column in table:

Weeknum = WEEKNUM('Table'[Date],2)

then create a measure

Measure = var _thisweek=SUMX(FILTER(ALLSELECTED('Table'),[Weeknum]=MAX([Weeknum])),[Visits])
var _lastweek=SUMX(FILTER(ALLSELECTED('Table'),[Weeknum]=MAX([Weeknum])-1),[Visits])
return DIVIDE(_thisweek-_lastweek,_lastweek)

vxinruzhumsft_0-1672905609020.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

You should create a Calendar Table with calculated column formulas for Year, Month number, Month name and week number.  Sort the Month name column by the Month number column.  Create a relationship (Many to One and Single) from the Date column of your Data Table to the Date column of the Calendar Table.  To your visual, drag Year and week number from the Calendar Table.  Write these measures

V = sum('Table'[Visits])

V last week = calculate([V],datesbetween(calendar[date],min(calendar[date])-7,max(calendar[date])-7))

WoW = divide(([V]-[V last week]),[V last week])

Hope this helps.


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

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.