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.
Hi All,
I have calculated the previous week sales using following measure:
Solved! Go to Solution.
Hi All,
I have resolved the issue.
I have make some change in measure to find the Last Week sale:
Sales WOW =
var C_week = SELECTEDVALUE('Date'[Week])
var C_Year = SELECTEDVALUE('Date'[Year])
var Max_Week = CALCULATE(MAX('Date'[Week]),ALL('Date'))
RETURN
CALCULATE([Sales], ALL('Date'),
FILTER(ALL('Date'),
IF(C_week = 1,
'Date'[Week] = Max_Week && 'Date'[Year] = C_Year - 1,
'Date'[Week] = C_week - 1 && 'Date'[Year] = C_Year)
),VALUES('Date'[week Day])
)
Now the last week sales shows correct and also successfully filters from the other visuals.(Showing correct data hor highlighted sales)
Thanks.
Hi All,
I have resolved the issue.
I have make some change in measure to find the Last Week sale:
Sales WOW =
var C_week = SELECTEDVALUE('Date'[Week])
var C_Year = SELECTEDVALUE('Date'[Year])
var Max_Week = CALCULATE(MAX('Date'[Week]),ALL('Date'))
RETURN
CALCULATE([Sales], ALL('Date'),
FILTER(ALL('Date'),
IF(C_week = 1,
'Date'[Week] = Max_Week && 'Date'[Year] = C_Year - 1,
'Date'[Week] = C_week - 1 && 'Date'[Year] = C_Year)
),VALUES('Date'[week Day])
)
Now the last week sales shows correct and also successfully filters from the other visuals.(Showing correct data hor highlighted sales)
Thanks.
@Anonymous , with help from these columns
new columns
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
try measures like
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))
both visual should use date from date table
Hi @amitchandak,
It isnot working Amit, now both ThisWeek and LastWeek measures not showing the Highlighted sales, instead of that it showing total sales. (I am using Date column from date table in both the visuals.)
Thanks for your responce.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |