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
Anonymous
Not applicable

Top N filter issue

Hi,

i have problems with Top N filter. I have simple Weeknum column created to show me week in which record was created. I want to filter last 8 weeks but when i apply Top N filter i get incorect values.

 

exemple: i have weeks from 5 to 20 formated as numbers and after aplying filter for the last 8 weeks i get [5,6,7,15,17,18,20] instead of [13,14,15,16,17,18,19,].

 

Help me with this, please tnx

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

Please set as below for topn setting:

 

1.JPG

 

Please make sure By value as above.

 

Regards,

Lin

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

How the changing values from average to sum or some other calculation changes the values we are getting?
I was getting different values with sum but with the column set to average in the filter gives correct values. Can you explain?

 

Anonymous
Not applicable

Hi,

 

it helped i my cse when i choose average of week.Tnk

Ii didn't know that you can change sum od average value in top n filter.

 

Tnx

amitchandak
Super User
Super User

@Anonymous ,

Please check my blog for this

https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123

I used week rank for that so that it can work across years

Last 8 period Sales =
Var _min = maxx(allselected('Date','Date'[period Rank]) -8
Var _max = maxx(allselected('Date','Date'[period Rank])
CALCULATE(SUM(Sales[Net Sales]),FILTER(all('Date'),'Date'[Week Rank]>=_min && 'Date'[Week Rank]<=_max))

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.