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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
NewbieJono
Post Partisan
Post Partisan

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 Partisan
Post Partisan

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors
Top Kudoed Authors