Forum Discussion
Can't filter by week
Hi!
I'm new to Power BI
I've facing some trouble trying to filter sales by week, as well as check WoW growth handling week offset.
I've made a calendar table as shown below (it's in portuguese, "date" is setted up as date, "semana" means week and "ano" means year, both setted up as numbers). Them I've related the date with my fact sales table and so on, but I just can't use the field "week" as an axis or filter to anything.
I'm pretty sure I'm missing something. Any thoughts?
Ty in advance
Hi,
For your issue, please check your relationships:
Try this measure to show growth of week:
Growth of Week = var LastWeekSales = CALCULATE(SUM('Fact'[Sales]),FILTER(ALLSELECTED('Calendar'),'Calendar'[WeekNo]=MAX('Calendar'[WeekNo])-1)) return IF(LastWeekSales<>BLANK()&&MAX('Fact'[Sales])<>BLANK(),(SUM('Fact'[Sales])-LastWeekSales)/LastWeekSales)And it works well here:
Here is my test pbix file, please check it:
If you still have issue, please share some sample fact data, tables' relationships and expected result as a screenshot for me to help you further.
Expect your reply!
Best Regards,
Giotto Zhi
2 Replies
- amitchandak
Super User
Anonymous
Refer to this file it usages Rank for Week prior week. It also has WTD . Please check all the pages
https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0
- v-gizhi-msft
Community Support
Hi,
For your issue, please check your relationships:
Try this measure to show growth of week:
Growth of Week = var LastWeekSales = CALCULATE(SUM('Fact'[Sales]),FILTER(ALLSELECTED('Calendar'),'Calendar'[WeekNo]=MAX('Calendar'[WeekNo])-1)) return IF(LastWeekSales<>BLANK()&&MAX('Fact'[Sales])<>BLANK(),(SUM('Fact'[Sales])-LastWeekSales)/LastWeekSales)And it works well here:
Here is my test pbix file, please check it:
If you still have issue, please share some sample fact data, tables' relationships and expected result as a screenshot for me to help you further.
Expect your reply!
Best Regards,
Giotto Zhi