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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I want to do weekly analysis on this dataset and I am having trouble doing it. As shown in attached picture 01 "Last Week Sales" it shows the total sum of sales for that period of time. Whereas picture 02 shows how sales are divided for specific products. I want to see the same division of sales in picture 01 as for "Last Week Sales". How I can do it?
I have created a measure for Last Week Sales, below is the code:
Your help will be really appreciated.
Thank you in advance
01
02
Solved! Go to Solution.
Hi @Anonymous
Try this measure
Last Week Previous Year Sales =
VAR products = VALUES ( 'sales'[masterMapping] )
RETURN
CALCULATE (
[Sales],
FILTER (
ALL ( 'sales' ),
'sales'[startDateTime].[Year] = SELECTEDVALUE ( 'sales'[startDateTime].[Year] ) - 1
&& 'sales'[Week] = SELECTEDVALUE ( 'sales'[Week] )
&& 'sales'[masterMapping] IN products
)
)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @Anonymous
Try this measure
Last Week Previous Year Sales =
VAR products = VALUES ( 'sales'[masterMapping] )
RETURN
CALCULATE (
[Sales],
FILTER (
ALL ( 'sales' ),
'sales'[startDateTime].[Year] = SELECTEDVALUE ( 'sales'[startDateTime].[Year] ) - 1
&& 'sales'[Week] = SELECTEDVALUE ( 'sales'[Week] )
&& 'sales'[masterMapping] IN products
)
)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |