Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi All,
I have a measure calculating Current Week and Previous week sales, grouped by the Status. However when it shows the previous week value, it duplicates the value and doesnt show it's statuses respective amount. as illustated below, the 19 for Previous week should be broken down into 12 and 7 for each status respectively. how do I fix this formula
Solved! Go to Solution.
Hi @SeanB004 ,
Please try code as below.
PreviousWeekOppts =
VAR _SUMMARIZE =
SUMMARIZE (
'Oppts (2)',
'Oppts (2)'[Week Ending Date],
'Oppts (2)'[Status],
"PreviousWeekOppts",
CALCULATE (
[Number of Oppts],
FILTER (
ALL ( 'Oppts (2)' ),
'Oppts (2)'[Status] = MAX ( 'Oppts (2)'[Status] )
&& 'Oppts (2)'[Week Ending Date]
= MAX ( 'Oppts (2)'[Week Ending Date] ) - 7
)
)
)
RETURN
SUMX ( _SUMMARIZE, [PreviousWeekOppts] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @SeanB004 ,
Please try code as below.
PreviousWeekOppts =
VAR _SUMMARIZE =
SUMMARIZE (
'Oppts (2)',
'Oppts (2)'[Week Ending Date],
'Oppts (2)'[Status],
"PreviousWeekOppts",
CALCULATE (
[Number of Oppts],
FILTER (
ALL ( 'Oppts (2)' ),
'Oppts (2)'[Status] = MAX ( 'Oppts (2)'[Status] )
&& 'Oppts (2)'[Week Ending Date]
= MAX ( 'Oppts (2)'[Week Ending Date] ) - 7
)
)
)
RETURN
SUMX ( _SUMMARIZE, [PreviousWeekOppts] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@SeanB004 , Try with a date table
Have these new columns in Date Table, Week Rank is Important in Date/Week Table
Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format
These measures can help
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
83 | |
75 | |
64 | |
39 | |
34 |
User | Count |
---|---|
107 | |
56 | |
52 | |
48 | |
40 |