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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
pal95
Helper III
Helper III

Calculate number of tasks from the previous week (ignoring filters)

Hi,

In my report, I have Inspectors who are conducting inspections. I calculate the number of inspections made by the Inspectors just by using COUNTROWS and week filters and it is working great, but I would like to add the comparison of the number of inspections from this week and the previous week.

So basically, if I have week 29 now and one of my inspectors made 15 inspections this week, I would like to make a KPI comparison between his week 29 score and week 28, when he did 13 inspections.

Any ideas on how to do this? Screens attached.Table.PNG

filter.PNG
Regards,

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @pal95 ,

 

You will need to create two tables, one for week of year and one for inspector name. Make sure there's no relationship between fact table and these two table then use these tables as slicers.

Create measures as below.

current_week = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[weeknum]=SELECTEDVALUE('weeknum'[weeknum])&&'Table'[name]=SELECTEDVALUE('name'[name])))

previous_week = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[weeknum]=SELECTEDVALUE('weeknum'[weeknum])-1&&'Table'[name]=SELECTEDVALUE('name'[name])))

Sample data for your reference.

1.PNG

 

Best Regards,

Jay

View solution in original post

I modify this a bit and it works

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @pal95 ,

 

You will need to create two tables, one for week of year and one for inspector name. Make sure there's no relationship between fact table and these two table then use these tables as slicers.

Create measures as below.

current_week = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[weeknum]=SELECTEDVALUE('weeknum'[weeknum])&&'Table'[name]=SELECTEDVALUE('name'[name])))

previous_week = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[weeknum]=SELECTEDVALUE('weeknum'[weeknum])-1&&'Table'[name]=SELECTEDVALUE('name'[name])))

Sample data for your reference.

1.PNG

 

Best Regards,

Jay

It works, but only to this particular indicator. How to make other visuals on the same to 'listen' to the filters?

I modify this a bit and it works

amitchandak
Super User
Super User

@pal95 , see if my blog can help

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors