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

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.

Reply
icdns
Post Patron
Post Patron

Ignore month filters, show weekly data

Hello, 

 

I would like to ask for your help in my weekly line graph data. In my below dashboard, I have a YEAR and MONTH filter. 

So if I filter my MONTH to AUGUST it will show the week "8/30/2020-9/5/2020" since there is an august 30 date (highlighted in yellow) 

 

So my problem is, the value is only showing the data of AUGUST 30, 2020 since my month filtered is AUGUST. 

Is it possible to also show the values of SEPTEMBER 1-5 since it belongs to the 8/30/2020-9/5/2020 week. 

 

I'm using below measures/columns for this visual: 

 
1. WEEK RANGE -- > i'm using this in my axis
Week_Range = [Week to Date (StartDate)] & " - " & [Week to Date (EndDate)]
  
2. FIELDMAN_%_AVG_OFFICE_GRAPH =
AVERAGEX(KEEPFILTERS(VALUES('TEAM'[OFFICE])), CALCULATE(([FIELD_%]))) + 0
 
3. MANUAL_%_AVG_OFFICE_GRAPH = AVERAGEX( KEEPFILTERS(VALUES('TEAM'[OFFICE])), CALCULATE([VALID_REMOVED_COUNT_1 divided by Contract_Assigned_Total plus FIELD_% average per OFFICE])) + 0

 

icdns_1-1601616984302.png

icdns_2-1601617000975.png

 

Thank you!

 

1 ACCEPTED SOLUTION

@icdns 

Try something like:

 

FIELD_%_AVG_OFFICE_GRAPH =
AVERAGEX(Filter(All('Team'),  [Date]>=Date(2020,8,1) && [Date]<=Date(2020,9,5)),CALCULATE(([FIELD_%]))) + 0

 

Regards
Paul

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@icdns , Try a week formula and try to use that in visual

example

Column in date table

Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)

//measure
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))

 

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...

Hi, 

 

I already have my start week and end week, can i just ignore the month filter? 🙂 

@icdns 
To ignore filters, the easiest way is turn off the interaction between slicer and the visual, in "edit interaction". Or you can add the specific date filter in the expression, and use All(Table) as the context. 

 

For example: 

Measure = Calculate(average([column1]), Filter(All(Table), [Date]>=Date(2020,8,1) &&[Date]<=Date(2020,9,5)))

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @V-pazhen-msft ,

 

Hello, how can i insert the All(Table) function in my measure? 🙂 

 

Here's my measure:

FIELD_%_AVG_OFFICE_GRAPH =
AVERAGEX(KEEPFILTERS(VALUES('TEAM'[OFFICE])), CALCULATE(([FIELD_%]))) + 0

 

Thanks a lot!

 

@icdns 

Try something like:

 

FIELD_%_AVG_OFFICE_GRAPH =
AVERAGEX(Filter(All('Team'),  [Date]>=Date(2020,8,1) && [Date]<=Date(2020,9,5)),CALCULATE(([FIELD_%]))) + 0

 

Regards
Paul

@icdns , That is what I was hoping this week can do.

 

or try like this. But I doubt this will work

 

measure =
var _max = maxx(allselcted(date), date[Week end date])
var _min = maxx(allselcted(date), date[date]) //or use week start date
return
calculate([measure], filter(all(date), date[date] <=_max && date[date] >=_min))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.