Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
NewbieJono
Post Patron
Post Patron

Total Weekly Figure in trend graph

hello, i have a date table linked to a Fact table.

 

is there a method of showing the total weekly volume Mon-Sun. and trend over the past 3 weeks. e,g a graph with 4 bars showing the total each week.

 

at the moment all the volumes are recoreded daily 

2 REPLIES 2
NewbieJono
Post Patron
Post Patron

Thanks for this, i have a date filter on the page with a single select of days.

 

at the moment the graph ignores the filter. but can i have the above to take the fitler date and provide results of the last 4 weeks from date selected

amitchandak
Super User
Super User

@NewbieJono , Last 4 week

 

Measures 

 

Last 4 weeks =
var _max1 = maxx(allselected('Table'), 'Table'[date])
var _max = maxx(filter(all(date), date[date] = _max1), week[Rank])
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]>=_max-4 && 'Date'[Week Rank]<=_max))

 

 

last 4 week based on today

 


4 Week today =
var _st = today() +-1*WEEKDAY(today(),2)+1 - 28
var _end =today()+ 7-1*WEEKDAY(today(),2)
return
CALCULATE(SUM(Sales[Sales Amount]),filter('Date','Date'[Date]>= _st && 'Date'[Date]<=_end )) //use all('Date') if need in filter

 

 

Columns you need in date table

 

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.