Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi Everyone,
Relatively new to PBI and I am attempting to create a sales dashboard using the last 52 week sales data by week, and I need to provide visibility into the sales data separated into a "Pre" and "Post" group of weeks based on a user defined week. This allows leadership to view how products performed leading up to, and then following a planogram change at the store level.
One challenge is that my weeks are deisgnated as YYYYWW, not in a dates table. ie. 202101-2020152 would be my week range for calnedar year 2021. This column is formated as a text column.
Any insight or help on how to build this visualization would be appreciated!
Solved! Go to Solution.
Hi @Anonymous ,
Do you want to display the data of 202102 and 202104 when you select 202103?
If so, you need to create a new table, and then use the following measure.
Measure =
CALCULATE(
SUM('Table'[Sales]),
FILTER(
'Table',
'Table'[Week] in { MAX('WeekNum'[Week]) - 1, MAX('WeekNum'[Week]) + 1 }
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Do you want to display the data of 202102 and 202104 when you select 202103?
If so, you need to create a new table, and then use the following measure.
Measure =
CALCULATE(
SUM('Table'[Sales]),
FILTER(
'Table',
'Table'[Week] in { MAX('WeekNum'[Week]) - 1, MAX('WeekNum'[Week]) + 1 }
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , what you want to compare is not clear. We have move year week, year and week into a new table (say Date)
and we can create week rank and these measures are possible
Week Rank = RANKX(all("Date"),"Date"[Year Week],,ASC,Dense) //YYYYWW format
measures
This Week = CALCULATE(sum("order"[Qty]), FILTER(ALL("Date"),"Date"[Week Rank]=max("Date"[Week Rank])))
Last Week = CALCULATE(sum("order"[Qty]), FILTER(ALL("Date"),"Date"[Week Rank]=max("Date"[Week Rank])-1))
Last year Week= CALCULATE(sum("order"[Qty]), FILTER(ALL("Date"),"Date"[Week Rank]=(max("Date"[Week Rank]) -52)))
YTD= CALCULATE(sum("order"[Qty]), FILTER(ALL("Date"),"Date"[Year]=max("Date"[Year]) && "Date"[Week] <= Max("Date"[Week]) ))
LYTD = CALCULATE(sum("order"[Qty]), FILTER(ALL("Date"),"Date"[Year]=max("Date"[Year])-1 && "Date"[Week] <= Max("Date"[Week])))
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 45 | |
| 44 | |
| 20 | |
| 19 |
| User | Count |
|---|---|
| 73 | |
| 71 | |
| 34 | |
| 33 | |
| 31 |